Rate This Document
Findability
Accuracy
Completeness
Readability

kupl_munlock

Unlocks the memory pages.

Interface Definition

int kupl_munlock(void *buffer, size_t count);

Parameters

Table 1 Parameter definitions

Parameter

Type

Description

Input/Output

buffer

void*

Pointer to the memory to be unlocked

Input

count

size_t

Size of the memory to be unlocked

Input

Return Value

  • Success: KUPL_OK
  • Failure: KUPL_ERROR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include <stdio.h> 
#include <stdlib.h>
#include "kupl.h" 

int main() 
{ 
    int len = 1024; 
    char *data = (char *)malloc(len);
    if (data == nullptr) {
        return 0;
    }
    kupl_mlock(data, len);
    kupl_munlock(data, len);
    free(data);
    return 0; 
}
  • The preceding example demonstrates the workflow of allocating memory, locking the memory, unlocking it, and finally freeing the memory.
  • The kupl_munlock function unlocks the memory pointed to by data.
  • The kupl_munlock function unlocks the memory. The availability of an SDMA device in the environment is a prerequisite for the kupl_munlock function to successfully unlock the memory.