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

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

Functions

SVM_FUNCTION SVM_Memory_Zone svm_memory_zone_new (const void *svm)
 This function creates an empty memory zone description. More...
 
SVM_FUNCTION void svm_memory_zone_append (const void *svm, SVM_Memory_Zone zone, const SVM_Type type, const SVM_Value_Integer times)
 This function appends an array of types of length given as integer value. More...
 
SVM_FUNCTION void svm_memory_zone_append__raw (const void *svm, SVM_Memory_Zone zone, const SVM_Type type, const SVM_Size times)
 This function appends an array of types of length given as integer value. More...
 
SVM_FUNCTION void svm_memory_zone_append_internal (const void *svm, SVM_Memory_Zone zone, const SVM_Type_Internal type, const SVM_Value_Integer times)
 This function appends an array of internal types of length given as integer value. More...
 
SVM_FUNCTION void svm_memory_zone_append_internal__raw (const void *svm, SVM_Memory_Zone zone, const SVM_Type_Internal type, const SVM_Size times)
 This function appends an array of internal types of length given as raw integer. More...
 
SVM_FUNCTION void svm_memory_zone_append_external (const void *svm, SVM_Memory_Zone zone, const SVM_Value_PluginEntryPoint type, const SVM_Value_Integer times)
 This function appends an array of plugin types of length given as integer value. More...
 
SVM_FUNCTION void svm_memory_zone_append_external__raw (const void *svm, SVM_Memory_Zone zone, const SVM_Value_PluginEntryPoint type, const SVM_Size times)
 This function appends an array of plugin types of length given as raw integer. More...
 
SVM_FUNCTION void svm_memory_zone_append_memory_zone (const void *svm, SVM_Memory_Zone zone, const SVM_Memory_Zone append)
 This function appends a memory zone to a memory zone. More...
 
SVM_FUNCTION void svm_memory_zone_insert_memory_zone (const void *svm, SVM_Memory_Zone zone, const SVM_Index index, const SVM_Memory_Zone insert)
 This function inserts a memory zone into a memory zone. More...
 
SVM_FUNCTION void svm_memory_zone_remove_memory_zone (const void *svm, SVM_Memory_Zone zone, const SVM_Index index, const SVM_Size size)
 This function remove a part within a memory zone. More...
 
SVM_FUNCTION void svm_memory_zone_replace_memory_zone (const void *svm, SVM_Memory_Zone zone, const SVM_Index index, const SVM_Memory_Zone replace)
 This function replace a memory zone inside a memory zone. More...
 
SVM_FUNCTION SVM_Index svm_memory_zone_find_memory_zone (const void *svm, SVM_Memory_Zone zone, const SVM_Index index, const SVM_Memory_Zone find)
 This function finds a memory zone inside a memory zone. More...
 
SVM_FUNCTION SVM_Size svm_memory_zone_get_size (const void *svm, const SVM_Memory_Zone zone)
 This function returns the memory zone size. More...
 
SVM_FUNCTION SVM_Type svm_memory_zone_get_type (const void *svm, const SVM_Memory_Zone zone, const SVM_Index index)
 This function returns one memory zone element. More...
 
SVM_FUNCTION SVM_Memory_Zone svm_memory_zone_copy (const void *svm, const SVM_Memory_Zone zone)
 This function creates a copy of a memory zone. More...
 
SVM_FUNCTION SVM_String svm_memory_zone_print (const void *svm, const SVM_Memory_Zone zone)
 This function creates a string representation of a memory zone. More...
 

Detailed Description

This module contains API functions to handle SVM memory zones.

Function Documentation

◆ svm_memory_zone_append()

SVM_FUNCTION void svm_memory_zone_append ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Type  type,
const SVM_Value_Integer  times 
)

This function appends an array of types of length given as integer value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]typeThe type to append.
[in]timesThe size of the array.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the times parameter is a negative integer.

◆ svm_memory_zone_append__raw()

SVM_FUNCTION void svm_memory_zone_append__raw ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Type  type,
const SVM_Size  times 
)

This function appends an array of types of length given as integer value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]typeThe type to append.
[in]timesThe size of the array.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the times parameter is a negative integer.

◆ svm_memory_zone_append_external()

SVM_FUNCTION void svm_memory_zone_append_external ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Value_PluginEntryPoint  type,
const SVM_Value_Integer  times 
)

This function appends an array of plugin types of length given as integer value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]typeThe plugin type name to append.
[in]timesThe size of the array.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the times parameter is a negative integer.

◆ svm_memory_zone_append_external__raw()

SVM_FUNCTION void svm_memory_zone_append_external__raw ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Value_PluginEntryPoint  type,
const SVM_Size  times 
)

This function appends an array of plugin types of length given as raw integer.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]typeThe plugin type name to append.
[in]timesThe size of the array.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_append_internal()

SVM_FUNCTION void svm_memory_zone_append_internal ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Type_Internal  type,
const SVM_Value_Integer  times 
)

This function appends an array of internal types of length given as integer value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]typeThe internal type to append.
[in]timesThe size of the array.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the times parameter is a negative integer.

◆ svm_memory_zone_append_internal__raw()

SVM_FUNCTION void svm_memory_zone_append_internal__raw ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Type_Internal  type,
const SVM_Size  times 
)

This function appends an array of internal types of length given as raw integer.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]typeThe internal type to append.
[in]timesThe size of the array.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_append_memory_zone()

SVM_FUNCTION void svm_memory_zone_append_memory_zone ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Memory_Zone  append 
)

This function appends a memory zone to a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]appendThe memory zone to append.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_copy()

SVM_FUNCTION SVM_Memory_Zone svm_memory_zone_copy ( const void *  svm,
const SVM_Memory_Zone  zone 
)

This function creates a copy of a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]zoneThe memory zone to copy.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_find_memory_zone()

SVM_FUNCTION SVM_Index svm_memory_zone_find_memory_zone ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Index  index,
const SVM_Memory_Zone  find 
)

This function finds a memory zone inside a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to search in.
[in]indexThe index where the search starts.
[in]findThe memory zone pattern to search.
Returns
The index of the first occurence when the pattern memory zone is found, and the memory zone size when not found.

The index can be set between 0 (begin) to the memory zone size (end).

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREwhen the index is outside the memory zone.

◆ svm_memory_zone_get_size()

SVM_FUNCTION SVM_Size svm_memory_zone_get_size ( const void *  svm,
const SVM_Memory_Zone  zone 
)

This function returns the memory zone size.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to check.
Returns
The number of types inside the memory zone.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_get_type()

SVM_FUNCTION SVM_Type svm_memory_zone_get_type ( const void *  svm,
const SVM_Memory_Zone  zone,
const SVM_Index  index 
)

This function returns one memory zone element.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to read.
[in]indexThe index to read.

The index can be set between 0 (begin) to the memory zone size-1 (end).

Returns
The type at the given index within the memory zone.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_insert_memory_zone()

SVM_FUNCTION void svm_memory_zone_insert_memory_zone ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Index  index,
const SVM_Memory_Zone  insert 
)

This function inserts a memory zone into a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]indexThe index where the memory zone is inserted.
[in]insertThe memory zone to insert.

The index can be set between 0 (begin) to the memory zone size (end).

Note
When the index is equal to the memory zone size, this instruction is equivalent to svm_memory_zone_append_memory_zone.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREwhen the index is outside the memory zone.

◆ svm_memory_zone_new()

SVM_FUNCTION SVM_Memory_Zone svm_memory_zone_new ( const void *  svm)

This function creates an empty memory zone description.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
See also
svm_memory_pointer_get_zone

◆ svm_memory_zone_print()

SVM_FUNCTION SVM_String svm_memory_zone_print ( const void *  svm,
const SVM_Memory_Zone  zone 
)

This function creates a string representation of a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]zoneThe memory zone to print.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_memory_zone_remove_memory_zone()

SVM_FUNCTION void svm_memory_zone_remove_memory_zone ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Index  index,
const SVM_Size  size 
)

This function remove a part within a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to extend.
[in]indexThe index where the memory zone is deleted.
[in]sizeThe size of the removed part of the memory zone.

The index can be set between 0 (begin) to the memory zone size (end).

Note
When the index is equal to the memory zone size, this instruction does nothing.
Exceptions
FA)FA
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREwhen the index is outside the memory zone.
FAILUREwhen the index+size is outside the memory zone.

◆ svm_memory_zone_replace_memory_zone()

SVM_FUNCTION void svm_memory_zone_replace_memory_zone ( const void *  svm,
SVM_Memory_Zone  zone,
const SVM_Index  index,
const SVM_Memory_Zone  replace 
)

This function replace a memory zone inside a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]zoneThe memory zone to change.
[in]indexThe index where the memory zone is replaced.
[in]replaceThe memory zone to replace.

The index can be set between 0 (begin) to the memory zone size (end).

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREwhen the index is outside the memory zone.
FAILUREwhen the replacement memory zone is outside the memory zone.