kupl_hbw_free
Unlock and free the on-package memory (OPM).
Interface Definition
void kupl_hbw_free(void *ptr);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
ptr |
void* |
Pointer to the OPM to be freed. |
Input |
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <stdio.h> #include <stdlib.h> #include "kupl.h" int main() { int len = 1024; char *data = (char *)kupl_hbw_malloc(len); if (data == nullptr) { return 0; } kupl_hbw_free(data); return 0; } |
- The preceding example demonstrates the process of allocating and then freeing the locked OPM.
- The kupl_hbw_free function unlocks and frees the memory pointed to by data.
- The kupl_hbw_free function unlocks and frees the memory if it is locked by the memory locking mechanism. Otherwise, the memory is directly freed.
Parent topic: Memory Management Functions