Simple Virtual Machine A simple but flexible virtual machine

Functions
SVM memory zone
SVM memories

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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | type | The type to append.
  [in] | times | The size of the array.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | type | The type to append.
  [in] | times | The size of the array.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | type | The plugin type name to append.
  [in] | times | The size of the array.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | type | The plugin type name to append.
  [in] | times | The size of the array.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | type | The internal type to append.
  [in] | times | The size of the array.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | type | The internal type to append.
  [in] | times | The size of the array.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | append | The memory zone to append.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | zone | The memory zone to copy.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to search in.
  [in] | index | The index where the search starts.
  [in] | find | The 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

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | when 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to check.

Returns
  The number of types inside the memory zone.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to read.
  [in] | index | The 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

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | index | The index where the memory zone is inserted.
  [in] | insert | The 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

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | when 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] | svm | The SVM pointer passed as first argument of the callback function.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | zone | The memory zone to print.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to extend.
  [in] | index | The index where the memory zone is deleted.
  [in] | size | The 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 |
  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | when the index is outside the memory zone.
  FAILURE | when 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | zone | The memory zone to change.
  [in] | index | The index where the memory zone is replaced.
  [in] | replace | The memory zone to replace.

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

Exceptions

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