Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mctp_memory.h File Reference

MCTP memory management functions. More...

Go to the source code of this file.

Functions

void * mctp_heap_alloc (size_t bytes)
 Allocate memory from the MCTP heap.
void mctp_heap_free (void *ptr)
 Free memory allocated from the MCTP heap.

Detailed Description

MCTP memory management functions.

Function Documentation

◆ mctp_heap_alloc()

void * mctp_heap_alloc ( size_t bytes)

Allocate memory from the MCTP heap.

This function allocates memory from the MCTP heap. The memory returned is suitable to be sent to libmctp function that take ownership of the memory. The allocated memory should be freed using mctp_heap_free() when it is no longer needed.

Parameters
bytesNumber of bytes to allocate.
Returns
Pointer to the allocated memory, or NULL if allocation failed.

◆ mctp_heap_free()

void mctp_heap_free ( void * ptr)

Free memory allocated from the MCTP heap.

This function frees memory that was previously allocated from the MCTP heap using mctp_heap_alloc(). The pointer passed to this function must have been returned by mctp_heap_alloc() and must not have been freed already.

Parameters
ptrPointer to the memory to free.