|
Google Cloud IoT device SDK for embedded C
1.0.2
|
Go to the source code of this file.
Functions | |
| void * | iotc_bsp_mem_alloc (size_t byte_count) |
| void * | iotc_bsp_mem_realloc (void *ptr, size_t byte_count) |
| void | iotc_bsp_mem_free (void *ptr) |
Manages platform memory.
For instance, custom implementations can use static instead of heap memory.
Definition in file iotc_bsp_mem.h.
| void* iotc_bsp_mem_alloc | ( | size_t | byte_count | ) |
Allocates memory and returns a pointer to the allocated block.
| [in] | byte_count | The number of bytes to allocate. |
| void iotc_bsp_mem_free | ( | void * | ptr | ) |
Frees a block of memory.
| [in] | ptr | A pointer to a memory block to free. |
| void* iotc_bsp_mem_realloc | ( | void * | ptr, |
| size_t | byte_count | ||
| ) |
Changes the size of a memory block and returns a pointer to the reallocated block.
If the new memory block size is smaller than the old memory block, the SDK saves the maximum amount of memory, even if the block moves to a new location. If the new size is larger, the SDK leaves the leftover memory empty.
This function is a convenience function that you don't need to implement. You can also reallocate memory with the iotc_bsp_mem_alloc() and and iotc_bsp_mem_free() functions.
| [in] | ptr | A pointer to a memory block to reallocate. |
| [in] | btye_count | The new size, in bytes, of the memory block. |