The API is defined in the header file sysroot-*-kos/include/kos/alloc.h
from the KasperskyOS SDK.
The API is intended for allocating and freeing memory. Allocated memory is a committed virtual memory region that can be accessed for read-and-write operations.
Information about API functions is provided in the table below.
alloc.h functions
Function |
Information about the function |
---|---|
|
Purpose Allocates memory. Parameters
Returned values If successful, the function returns the pointer to the allocated memory, otherwise it returns |
|
Purpose Allocates memory. Parameters
Returned values If successful, the function returns the pointer to the allocated memory, otherwise it returns |
|
Purpose Allocates memory and initializes it with zeros. Parameters
Returned values If successful, the function returns the pointer to the allocated memory, otherwise it returns |
|
Purpose Deallocates memory. Parameters
Returned values N/A |
|
Purpose Gets the actual size of allocated memory. The actual size of allocated memory exceeds the requested size because it includes the size of service data and also may be increased due to alignment when the Parameters
Returned values Actual size of allocated memory (in bytes). |
|
Purpose Gets the size of memory that was requested when it is allocated. The actual size of allocated memory exceeds the requested size because it includes the size of service data and also may be increased due to alignment when the Parameters
Returned values Size (in bytes) of memory that was requested when it is allocated. |