Changeset 9662 for code/branches/core6/src/libraries/core/object
- Timestamp:
- Aug 24, 2013, 7:04:40 PM (11 years ago)
- Location:
- code/branches/core6/src/libraries/core/object
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/object/Listable.cc
r9661 r9662 100 100 } 101 101 102 /* static */ SmallObjectAllocator& Listable::getObjectListElementAllocator() 103 { 104 static SmallObjectAllocator allocator(sizeof(ObjectListElement<Listable>), 1024); 105 return allocator; 106 } 107 102 108 /* static */ void Listable::deleteObjectListElement(ObjectListBaseElement* element) 103 109 { 104 delete element; 110 element->~ObjectListBaseElement(); 111 Listable::getObjectListElementAllocator().free(element); 105 112 } 106 113 } -
code/branches/core6/src/libraries/core/object/Listable.h
r9661 r9662 63 63 64 64 private: 65 static SmallObjectAllocator& getObjectListElementAllocator(); 66 65 67 template <class T> 66 68 static ObjectListElement<T>* createObjectListElement(T* object) 67 69 { 68 return new ObjectListElement<T>(object); 70 void* chunk = Listable::getObjectListElementAllocator().alloc(); 71 return new (chunk) ObjectListElement<T>(object); 69 72 } 70 73
Note: See TracChangeset
for help on using the changeset viewer.