You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2003/05/23 19:07:41 UTC
cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMDocumentImpl.cpp
knoaman 2003/05/23 10:07:41
Modified: c/src/xercesc/dom/impl DOMDocumentImpl.cpp
Log:
Use the per instance memory manager.
Revision Changes Path
1.43 +6 -6 xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp
Index: DOMDocumentImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- DOMDocumentImpl.cpp 23 May 2003 03:31:25 -0000 1.42
+++ DOMDocumentImpl.cpp 23 May 2003 17:07:41 -0000 1.43
@@ -237,7 +237,7 @@
// Note: the cloned document node goes on the system heap. All other
// nodes added to the new document will go on that document's heap,
// but we need to construct the document first, before its heap exists.
- DOMDocumentImpl *newdoc = new DOMDocumentImpl(fMemoryManager);
+ DOMDocumentImpl *newdoc = new (fMemoryManager) DOMDocumentImpl(fMemoryManager);
// then the children by _importing_ them
if (deep)
@@ -821,7 +821,7 @@
// Try to allocate the block
void* newBlock = 0;
try {
- newBlock = fMemoryManager->allocate(sizeOfHeader + amount); //new char[amount + sizeOfHeader];
+ newBlock = fMemoryManager->allocate((sizeOfHeader + amount) * sizeof(char)); //new char[amount + sizeOfHeader];
}
catch (...) {
ThrowXML(RuntimeException, XMLExcepts::Out_Of_Memory);
@@ -860,7 +860,7 @@
// Get a new block from the system allocator.
void* newBlock = 0;
try {
- newBlock = fMemoryManager->allocate(kHeapAllocSize); //new char[kHeapAllocSize];
+ newBlock = fMemoryManager->allocate(kHeapAllocSize * sizeof(char)); //new char[kHeapAllocSize];
}
catch (...) {
ThrowXML(RuntimeException, XMLExcepts::Out_Of_Memory);
@@ -1188,7 +1188,7 @@
(
29
, true
- , new HashPtr()
+ , new (fMemoryManager) HashPtr()
, fMemoryManager
);
}
@@ -1217,7 +1217,7 @@
// clone the key first, and create the DOMUserDataRecord
// create on the heap and adopted by the hashtable which will delete it upon removal.
- node_userDataTable->put((void*)getPooledString(key), new DOMUserDataRecord(data, handler));
+ node_userDataTable->put((void*)getPooledString(key), new (fMemoryManager) DOMUserDataRecord(data, handler));
}
else {
if (node_userDataTable->isEmpty())
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org