This module contains API functions to handle SVM memory allocation.
More...
This module contains API functions to handle SVM memory allocation.
◆ svm_memory_allocate()
This function allocates a zone in a memory.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | kernel | The kernel in which the targeted memory is. |
[in] | zone | The zone description to allocate. |
- Warning
- The allocated memory is local and will be freed at the end of the current SVM function. Please refer to the svm_memory_scope_set_global and svm_memory_pointer_list_accessible API functions to create global memory.
- Note
- The allocated memory is not initialised. It means each allocated addresses contains a type but no value.
- Returns
- The pointer containing the zone location.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours. |
- See also
- svm_memory_scope_set_global
-
svm_memory_pointer_list_accessible
-
svm_process_ownership_lock
-
svm_kernel_get_current
◆ svm_memory_allocate_address()
This function allocates a zone in a memory at a specified address.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | kernel | The kernel in which the targeted memory is. |
[in] | zone | The zone description to allocate. |
[in] | address | The address where to allocate the memory. |
- Warning
- The allocated memory is local and will be freed at the end of the current SVM function. Please refer to the svm_memory_scope_set_global and svm_memory_pointer_list_accessible API functions to create global memory.
- Note
- The allocated memory is not initialised. It means each allocated addresses contains a type but no value.
- Returns
- The pointer containing the zone location when the allocation succeeds. A null pointer is returned otherwise.
Example:
{
}
SVM_FUNCTION SVM_Value_Pointer svm_memory_allocate_address(const void *svm, const SVM_Kernel kernel, const SVM_Memory_Zone zone, const SVM_Address address)
This function allocates a zone in a memory at a specified address.
SVM_TYPE typedef const void * SVM_Value_Pointer
This type is used to represent a pointer the SVM can store in one of its memories.
Definition: svm.h:570
@ MEMORY
raised on memory access failure
Definition: svm.h:390
SVM_FUNCTION void svm_processor_current_raise_error_internal__raw(const void *svm, const SVM_Interruption_Internal interruption, const char *message)
This function interrupts the current processor and the current instruction execution from an internal...
SVM_FUNCTION SVM_Kernel svm_kernel_get_current(const void *svm)
This function retrieves the current kernel.
SVM_FUNCTION SVM_Boolean svm_value_state_is_null(const void *svm, const SVM_Value value)
This function checks whether a value is a null value.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours. |
- See also
- svm_memory_scope_set_global
-
svm_memory_pointer_list_accessible
-
svm_process_ownership_lock
-
svm_kernel_get_current
-
svm_value_state_is_null
◆ svm_memory_free()
This function frees a memory zone.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | kernel | The kernel in which the targeted memory is. |
[in] | pointer | The pointer locating the memory zone. |
The targeted addresses are removed from the memory.
- Note
- The scope of the memory is unchanged.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
- See also
- svm_memory_scope_set_local