Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

Interface «api::Heap»

Heap memory interface.

public: virtual ~Heap();

Destructor.

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

Allocates memory.

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

Returns:
pointer to allocated memory or NULL.

public: virtual void free(void* ptr);

Frees an allocated memory.

Parameters:
ptr — pointer to allocated memory.

public: virtual bool isConstructed() const;

Tests if this object has been constructed.

public: static bool isObject(const Type* obj);

Tests if given object has been constructed object.

public: virtual void setToggle(::api::Toggle*& toggle);

Sets an allocated memory.

The method allows disabling and enabling thread context switching when memory is being allocated or freed. Thus, the best way is to pass an interface of global interrupt toggling. The parameter type is reference to pointer, as when referenced pointer equals to NULL, no blocks are happening.

Parameters:
toggle — reference to pointer to some controller.

Back to class list