Simple Virtual Machine
A simple but flexible virtual machine
SVM memory scope

This module contains API functions to handle SVM memory scope. More...

Functions

SVM_FUNCTION void svm_memory_scope_set_local (const void *svm, const SVM_Kernel kernel, const SVM_Value_Pointer pointer)
 This function changes the scope of a memory zone. More...
 
SVM_FUNCTION void svm_memory_scope_set_global (const void *svm, const SVM_Kernel kernel, const SVM_Value_Pointer pointer)
 This function changes the scope of a memory zone. More...
 
SVM_FUNCTION void svm_memory_scope_set_local_alias (const void *svm, const SVM_Kernel kernel, const SVM_Value_String alias)
 This function changes the scope of a memory alias from a string value. More...
 
SVM_FUNCTION void svm_memory_scope_set_local_alias__string (const void *svm, const SVM_Kernel kernel, const SVM_String alias)
 This function changes the scope of a memory alias from a SVM_String. More...
 
SVM_FUNCTION void svm_memory_scope_set_local_alias__raw (const void *svm, const SVM_Kernel kernel, const char *alias)
 This function changes the scope of a memory alias from a C nul-terminated string. More...
 
SVM_FUNCTION void svm_memory_scope_set_global_alias (const void *svm, const SVM_Kernel kernel, const SVM_Value_String alias)
 This function changes the scope of a memory alias from a string value. More...
 
SVM_FUNCTION void svm_memory_scope_set_global_alias__string (const void *svm, const SVM_Kernel kernel, const SVM_String alias)
 This function changes the scope of a memory alias from a SVM_String. More...
 
SVM_FUNCTION void svm_memory_scope_set_global_alias__raw (const void *svm, const SVM_Kernel kernel, const char *alias)
 This function changes the scope of a memory alias from a C nul-terminated string. More...
 

Detailed Description

This module contains API functions to handle SVM memory scope.

A memory scope corresponds to the life time of memory addresses.

See also
SVM kernels

Function Documentation

◆ svm_memory_scope_set_global()

SVM_FUNCTION void svm_memory_scope_set_global ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Pointer  pointer 
)

This function changes the scope of a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]pointerThe pointer locating the memory zone.

The targeted addresses are removed from the processor current state and will not be freed at the end of the SVM function.

This API function allows delegation of memory liberation at the end of the current function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
See also
svm_memory_scope_set_global_alias
svm_memory_scope_set_global_alias__string
svm_memory_scope_set_global_alias__raw

◆ svm_memory_scope_set_global_alias()

SVM_FUNCTION void svm_memory_scope_set_global_alias ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_String  alias 
)

This function changes the scope of a memory alias from a string value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]aliasThe alias to change.

The targeted alias is removed from the processor current state and will not be freed at the end of the SVM function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_memory_scope_set_local
svm_process_ownership_lock
svm_kernel_get_current

◆ svm_memory_scope_set_global_alias__raw()

SVM_FUNCTION void svm_memory_scope_set_global_alias__raw ( const void *  svm,
const SVM_Kernel  kernel,
const char *  alias 
)

This function changes the scope of a memory alias from a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]aliasThe alias to change.

The targeted alias is removed from the processor current state and will not be freed at the end of the SVM function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_memory_scope_set_local
svm_process_ownership_lock
svm_kernel_get_current

◆ svm_memory_scope_set_global_alias__string()

SVM_FUNCTION void svm_memory_scope_set_global_alias__string ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_String  alias 
)

This function changes the scope of a memory alias from a SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]aliasThe alias to change.

The targeted alias is removed from the processor current state and will not be freed at the end of the SVM function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_memory_scope_set_local
svm_process_ownership_lock
svm_kernel_get_current

◆ svm_memory_scope_set_local()

SVM_FUNCTION void svm_memory_scope_set_local ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Pointer  pointer 
)

This function changes the scope of a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]pointerThe pointer locating the memory zone.

The targeted addresses are put in the processor current state and will be freed at the end of the SVM function.

This API function allows delegation of memory liberation at the end of the current function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
See also
svm_memory_scope_set_local_alias
svm_memory_scope_set_local_alias__string
svm_memory_scope_set_local_alias__raw

◆ svm_memory_scope_set_local_alias()

SVM_FUNCTION void svm_memory_scope_set_local_alias ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_String  alias 
)

This function changes the scope of a memory alias from a string value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]aliasThe alias to change.

The targeted alias is put in the processor current state and will be freed at the end of the SVM function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_memory_scope_set_local
svm_process_ownership_lock
svm_kernel_get_current

◆ svm_memory_scope_set_local_alias__raw()

SVM_FUNCTION void svm_memory_scope_set_local_alias__raw ( const void *  svm,
const SVM_Kernel  kernel,
const char *  alias 
)

This function changes the scope of a memory alias from a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]aliasThe alias to change.

The targeted alias is put in the processor current state and will be freed at the end of the SVM function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_memory_scope_set_local
svm_process_ownership_lock
svm_kernel_get_current

◆ svm_memory_scope_set_local_alias__string()

SVM_FUNCTION void svm_memory_scope_set_local_alias__string ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_String  alias 
)

This function changes the scope of a memory alias from a SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]aliasThe alias to change.

The targeted alias is put in the processor current state and will be freed at the end of the SVM function.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_memory_scope_set_local
svm_process_ownership_lock
svm_kernel_get_current