Eneboo - Documentación para desarrolladores
|
00001 #ifndef _LOCKMALLOCHEAP_H_ 00002 #define _LOCKMALLOCHEAP_H_ 00003 00004 #include "hldefines.h" 00005 00006 00007 // Just lock malloc (unlike LockedHeap, which locks both malloc and 00008 // free). Meant to be combined with something like RedirectFree, which will 00009 // implement free. 00010 00011 namespace Hoard { 00012 00013 template <typename Heap> 00014 class LockMallocHeap : public Heap { 00015 public: 00016 MALLOC_FUNCTION INLINE void * malloc (size_t sz) { 00017 HL::Guard<Heap> l (*this); 00018 return Heap::malloc (sz); 00019 } 00020 }; 00021 00022 } 00023 00024 #endif