#include <buddy.hpp>
Public Member Functions | |
| void | setFree (bool free) |
| bool | getFree () |
| void | setAllocationTimeStamp (Uint32 cTime) |
| Uint32 | getAllocationTimeStamp () |
Public Attributes | |
| Uint32 | allocationTimeStamp |
| Uint32 | nextSegmentOfSameSize |
| Uint32 | prevSegmentOfSameSize |
Definition at line 108 of file buddy.hpp.
| Uint32 Chunk256::getAllocationTimeStamp | ( | ) |
Definition at line 42 of file buddy.cpp.
References allocationTimeStamp.
00042 { 00043 Uint32 onMask = 0x80000000; 00044 allocationTimeStamp = allocationTimeStamp ^ onMask; 00045 printf("\nGet allocation time. Time is %d", allocationTimeStamp); 00046 return allocationTimeStamp; 00047 };
| bool Chunk256::getFree | ( | ) |
Definition at line 28 of file buddy.cpp.
References allocationTimeStamp.
00028 { 00029 Uint32 offMask = 0x0; 00030 return ((allocationTimeStamp | offMask) == offMask ? true : false); 00031 }
| void Chunk256::setAllocationTimeStamp | ( | Uint32 | cTime | ) |
Definition at line 33 of file buddy.cpp.
References allocationTimeStamp.
Referenced by BuddyMemory::getSegment().
00033 { 00034 // Bits 1-31 of allocationTimeStamp represent the allocation time for segment 00035 00036 // printf("\nSet allocation time. Current time %d", cTime); 00037 Uint32 onMask = 0x80000000; // A mask to set the 0 bit to 1 00038 allocationTimeStamp = 0x0; 00039 allocationTimeStamp = onMask | cTime; 00040 }
Here is the caller graph for this function:

| void Chunk256::setFree | ( | bool | free | ) |
Definition at line 19 of file buddy.cpp.
References allocationTimeStamp.
00019 { 00020 // Bit 0 of allocationTimeStamp represents if the segment is free or not 00021 Uint32 offMask = 0x0; // A mask to set the 0 bit to 0 00022 allocationTimeStamp = 0x0; 00023 if(free) 00024 // Set this bit to 0, if segment should be free 00025 allocationTimeStamp = allocationTimeStamp & offMask; 00026 }
Definition at line 109 of file buddy.hpp.
Referenced by getAllocationTimeStamp(), getFree(), setAllocationTimeStamp(), and setFree().
Definition at line 112 of file buddy.hpp.
Referenced by BuddyMemory::addToFreeSegmentList(), BuddyMemory::allocate(), and BuddyMemory::removeFromFreeSegmentList().
Definition at line 116 of file buddy.hpp.
Referenced by BuddyMemory::addToFreeSegmentList(), BuddyMemory::allocate(), and BuddyMemory::removeFromFreeSegmentList().
1.4.7

