Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

Class «eoos::lib::Heap»

Heap memory.

Hardware address for system heap memory has to be aligned to eight.

public: Heap(size_t size, api::Mutex& mutex);

Constructor.

Parameters:
size — Total heap size.
mutex — A mutex to protect memory allocation.

public: ~Heap();

Destructor.

public: virtual void* allocate(size_t size, void* ptr);

Allocates memory.

Parameters:
size — Required memory size in byte.
ptr — NULLPTR value becomes to allocate memory, and other given values are simply returned as memory address.

Returns:
Pointer to allocated memory or NULLPTR.

public: virtual void free(void* ptr);

Frees allocated memory.

Parameters:
ptr — Pointer to allocated memory.

public: virtual bool_t isConstructed() const;

Tests if this object has been constructed.

Returns:
True if object has been constructed successfully.

public: static void operator delete(void*);

Operator delete.

public: static void operator delete(void*, uintptr_t);

Operator delete.

public: static void* operator new(size_t, uintptr_t const ptr);

Operator new.

Function initiates a building of heap memory checks and tests self memory structure data and leads to call the class constructor.

Parameters:
size — Unused.
ptr — Aligned to eight memory address.

Returns:
Address of memory or NULLPTR.

Back to class list