22 #include <ndb_global.h>
24 typedef unsigned int Uint32;
25 typedef unsigned short Uint16;
26 typedef unsigned long long Uint64;
29 const int UNDEFINED_CHUNK = -2;
32 const int END_OF_CHUNK_LIST = -1;
37 const int ALLOCATION_TIMEOUT = 10000;
41 enum FreeSegmentSize {
62 bool memoryAvailable();
65 bool allocate(
int nChunksToAllocate);
68 void removeFromFreeSegmentList(
int sz,
int index);
71 void release(
int releaseId,
int size);
74 void addToFreeSegmentList(
int sz,
int index);
76 bool getSegment(Uint32 size,
Segment * dst);
78 void refreshTime(Uint32 time);
81 Uint32 logTwoPlus(Uint32 arg);
87 Uint32 freeSegment[sz_MAX];
90 Uint32* startOfMemoryBlock;
93 Uint32 totalNoOfChunks;
105 Uint32* segmentAddress;
106 Uint64 _padding_NOT_TO_BE_USED_;
111 Uint32 allocationTimeStamp;
114 Uint32 nextSegmentOfSameSize;
118 Uint32 prevSegmentOfSameSize;
123 void setFree(
bool free);
127 void setAllocationTimeStamp(Uint32 cTime);
129 Uint32 getAllocationTimeStamp();