Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM access control memory
SVM access control

This module contains API functions to handle SVM access control memory limit. More...

## Functions
SVM_FUNCTION SVM_Boolean | svm_accesscontrol_has_memory (const void *svm, const SVM_AccessControl access_control)
| This function checks whether a quota for a SVM code execution contains a limit for memory.
SVM_FUNCTION unsigned long int | svm_accesscontrol_get_memory (const void *svm, const SVM_AccessControl access_control)
| This function retrieves the remaining memory counter from a quota for a SVM code execution.
SVM_FUNCTION void | svm_accesscontrol_set_memory (const void *svm, SVM_AccessControl access_control, const unsigned long int memory)
| This function changes the remaining memory counter within a quota for a SVM code execution.

## Detailed Description

This module contains API functions to handle SVM access control memory limit.

## Function Documentation

## ◆ svm_accesscontrol_get_memory()

SVM_FUNCTION unsigned long int svm_accesscontrol_get_memory | ( | const void * | svm,
|  | const SVM_AccessControl | access_control
| ) |  |

This function retrieves the remaining memory counter from a quota for a SVM code execution.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | access_control | The access control to check.

Returns
  The number of remaining memory to allocate.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the access control has no memory limit.

See also
  svm_accesscontrol_has_memory

## ◆ svm_accesscontrol_has_memory()

SVM_FUNCTION SVM_Boolean svm_accesscontrol_has_memory | ( | const void * | svm,
|  | const SVM_AccessControl | access_control
| ) |  |

This function checks whether a quota for a SVM code execution contains a limit for memory.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | access_control | The access control to check.

Returns
  TRUE when the access control has a memory limit, FALSE otherwise.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)

## ◆ svm_accesscontrol_set_memory()

SVM_FUNCTION void svm_accesscontrol_set_memory | ( | const void * | svm,
|  | SVM_AccessControl | access_control,
|  | const unsigned long int | memory
| ) |  |

This function changes the remaining memory counter within a quota for a SVM code execution.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | access_control | The access control to update.
  [in] | memory | The remaining memory to allocate.

This function changes the number of remaining memory on the access control:

- if the access control had no limit, a limit is set to the number of remaining memory,
- the number of remaining memory can not be increased, and the function will have no effect.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)