Eneboo - Documentación para desarrolladores
|
00001 /* -*- C++ -*- */ 00002 00003 #ifndef _SBRKHEAP_H_ 00004 #define _SBRKHEAP_H_ 00005 00006 #ifdef WIN32 00007 00008 // If we're using Windows, we'll need to link in sbrk.c, 00009 // a replacement for sbrk(). 00010 00011 extern "C" void * sbrk (size_t sz); 00012 00013 #endif 00014 00015 /* 00016 * @class SbrkHeap 00017 * @brief A source heap that is a thin wrapper over sbrk. 00018 * 00019 * As it stands, memory cannot be returned to sbrk(). 00020 * This is not a significant limitation, since only memory 00021 * at the end of the break point can ever be returned anyway. 00022 */ 00023 00024 class SbrkHeap { 00025 public: 00026 SbrkHeap (void) 00027 {} 00028 00029 inline void * malloc (size_t sz) { 00030 return sbrk(sz); 00031 } 00032 00033 inline void free (void *) { } 00034 inline int remove (void *) { return 0; } 00035 }; 00036 00037 00038 00039 #endif 00040