OSMetaClassDefineReservedUnused(OSOrderedSet, 6);
OSMetaClassDefineReservedUnused(OSOrderedSet, 7);
-#if OSALLOCDEBUG
-extern "C" {
- extern int debug_container_malloc_size;
-};
-#define ACCUMSIZE(s) do { debug_container_malloc_size += (s); } while(0)
-#else
-#define ACCUMSIZE(s)
-#endif
struct _Element {
const OSMetaClassBase * obj;
return false;
size = sizeof(_Element) * inCapacity;
- array = (_Element *) kalloc(size);
+ array = (_Element *) kalloc_container(size);
if (!array)
return false;
orderingRef = inOrderingRef;
bzero(array, size);
- ACCUMSIZE(size);
+ OSCONTAINER_ACCUMSIZE(size);
- return this;
+ return true;
}
OSOrderedSet * OSOrderedSet::
if (array) {
kfree(array, sizeof(_Element) * capacity);
- ACCUMSIZE( -(sizeof(_Element) * capacity) );
+ OSCONTAINER_ACCUMSIZE( -(sizeof(_Element) * capacity) );
}
super::free();
}
newSize = sizeof(_Element) * finalCapacity;
- newArray = (_Element *) kalloc(newSize);
+ newArray = (_Element *) kalloc_container(newSize);
if (newArray) {
oldSize = sizeof(_Element) * capacity;
- ACCUMSIZE(newSize - oldSize);
+ OSCONTAINER_ACCUMSIZE(((size_t)newSize) - ((size_t)oldSize));
bcopy(array, newArray, oldSize);
bzero(&newArray[capacity], newSize - oldSize);