LIBINT
2.1.0-stable
|
MemoryBlock<Address,Size> describes a block of raw memory addressed via Address and size described by Size. More...
#include <memory.h>
Public Types | |
typedef A | Address |
typedef S | Size |
Public Member Functions | |
MemoryBlock (const Address &address, const Size &size, bool free, const SafePtr< MemoryBlock > &left, const SafePtr< MemoryBlock > &right) | |
MemoryBlock (const MemoryBlock &other) | |
const MemoryBlock & | operator= (const MemoryBlock &other) |
copy A to this | |
Address | address () const |
Returns address. | |
Size | size () const |
Returns size. | |
bool | free () const |
Returns true if the block is free. | |
SafePtr< MemoryBlock > | left () const |
Returns the left adjacent block. | |
SafePtr< MemoryBlock > | right () const |
Returns the right adjacent block. | |
void | left (const SafePtr< MemoryBlock > &l) |
Sets the left adjacent block. | |
void | right (const SafePtr< MemoryBlock > &r) |
Sets the right adjacent block. | |
void | set_address (const Address &address) |
Sets the address. | |
void | set_size (const Size &size) |
Sets the size. | |
void | set_free (bool free) |
Sets block's free status. | |
const MemoryBlock & | merge (const MemoryBlock &other) |
Merge A to this (does not check if merge can happen – can_merge(*this,*A) must be already satisfied). The left/right pointers are not changed. | |
Static Public Member Functions | |
static bool | size_less_than (const SafePtr< MemoryBlock > &i, const SafePtr< MemoryBlock > &j) |
Returns true if the size of *i is less than the size of *j. | |
static bool | size_eq (SafePtr< MemoryBlock > i, Size sz) |
Returns true if the size of *i equals sz. More... | |
static bool | size_geq (SafePtr< MemoryBlock > i, Size sz) |
Returns true if the size of *i greater or equal than sz. More... | |
static bool | address_less_than (const SafePtr< MemoryBlock > &i, const SafePtr< MemoryBlock > &j) |
Returns true if the address of *i is less than the address of *j. | |
static bool | address_eq (SafePtr< MemoryBlock > i, Address a) |
Returns true if the address of *i equals a. More... | |
static bool | is_free (const SafePtr< MemoryBlock > &i) |
Returns true if *i is free. | |
MemoryBlock<Address,Size> describes a block of raw memory addressed via Address and size described by Size.
|
inlinestatic |
Returns true if the address of *i equals a.
Note that the arguments are not passed by reference since this function is designed to be converted to std::pointer_to_binary_function, which adds references to the arguments
Referenced by libint2::MemoryManager::find_block().
|
inlinestatic |
Returns true if the size of *i equals sz.
Note that the arguments are not passed by reference since this function is designed to be converted to std::pointer_to_binary_function, which adds references to the arguments
Referenced by libint2::WorstFitMemoryManager::alloc(), libint2::BestFitMemoryManager::alloc(), libint2::FirstFitMemoryManager::alloc(), and libint2::LastFitMemoryManager::alloc().
|
inlinestatic |
Returns true if the size of *i greater or equal than sz.
Note that the arguments are not passed by reference since this function is designed to be converted to std::pointer_to_binary_function, which adds references to the arguments
Referenced by libint2::FirstFitMemoryManager::alloc(), and libint2::LastFitMemoryManager::alloc().