# Documentation VISION (VAPI) : MEM Interface

|  | Documentation VISION (VAPI) |  | Last update : 03/28/20
| MEM INTERFACE |

Abstract
Préfixe de l'interface | Me
Nombre de fonctions | 8
Description | Set of functions allowing to manipulate memory areas, mostly image oriented + dynamic memory allocations with stats/boundchecks though vision.log

Prototype | void cdecl MeSCopyMemory8(char *dst, char *src, unsigned long nb_elems_dst, unsigned long nb_elems_src)
Parameters | [OUT] dst : Pointer to memory area to change [IN] src : Pointer to memory area to copy from [OUT] nb_elems_dst : Number of 8bit elements in destination area [IN] nb_elems_src : Number of 8bit elements in source area
Return | None
Description | Copies a 8bit memory area by respecting the number of elements in each zone. Very useful to perform changes on a line. Not working with overlapping zones.
Comments | Number of elements shall not be more than 65535 due to specific optimization. If a 68030 processor is available, VISION will use automatically an optimzed routine.
VAPI Version | 1.02 or greater

Prototype | void cdecl MeSCopyMemory16(char *dst, char *src, unsigned long nb_elems_dst, unsigned long nb_elems_src)
Parameters | [OUT] dst : Pointer to memory area to change [IN] src : Pointer to memory area to copy from [OUT] nb_elems_dst : Number of 16bit elements in destination area [IN] nb_elems_src : Number of 16bit elements in source area
Retour | None
Description | Copies a 16bit memory area by respecting the number of elements in each zone. Very useful to perform changes on a line. Not working with overlapping zones.
Return | Number of elements shall not be more than 32767 due to specific optimization. If a 68030 processor is available, VISION will use automatically an optimzed routine.
VAPI Version | 1.02 or greater

Prototype | void cdecl MeSCopyMemory32(char *dst, char *src, unsigned long nb_elems_dst, unsigned long nb_elems_src)
Parameters | [OUT] dst : Pointer to memory area to change [IN] src : Pointer to memory area to copy from [OUT] nb_elems_dst : Number of 32bit elements in destination area [IN] nb_elems_src : Number of 32bit elements in source area
Return | None
Description | Copies a 32bit memory area by respecting the number of elements in each zone. Very useful to perform changes on a line. Not working with overlapping zones.
Comments | Number of elements shall not be more than 16383 due to specific optimization. If a 68030 processor is available, VISION will use automatically an optimzed routine.
VAPI Version | 1.02 or greater

Prototype | void* cdecl MeXcalloc(unsigned long size)
Parameters | [IN] size : Number of bytes to allocate
Return | Pointer to allocated memory of size bytes, NULL if error
Description | Similar to malloc 'C' function from stdlib
Comments | VISION will keep track of this allocation and check against leak or memory under/over flows.
VAPI Version | 1.05 or greater

Prototype | void* cdecl MeXrealloc(void* ptr, unsigned long size)
Parameters | [IN] ptr : Currently allocated pointer to adjust size [IN] size : Number of bytes to allocate
Return | Pointer to allocated memory of size bytes, NULL if error
Description | Similar to realloc 'C' function from stdlib
Comments | VISION will keep track of this allocation and check against leak or memory under/over flows.
VAPI Version | 1.05 or greater

Prototype | void cdecl MeXfree(void* ptr)
Parameters | [IN] ptr : Pointer to memory to be freed
Return | None
Description | Similar to free 'C' function from stdlib
Comments | VISION will check pointer is valid and if under/over flows has occured
VAPI Version | 1.05 or greater

Prototype | void* cdecl MeXcalloc(unsigned long nb_elems, unsigned long elem_size)
Parameters | [IN] nb_elems : Number of elements to allocate [IN] elem_size : Sze of an element in bytes
Return | Pointer to allocated memory of size bytes, NULL if error
Description | Similar to calloc 'C' function from stdlib; like malloc but allocated memory is zeroed.
Comments | VISION will keep track of this allocation and check against leak or memory under/over flows.
VAPI Version | 1.05 or greater

Prototype | char* cdecl MeXstrdup(char* s)
Parameters | [IN] s : Pointer to string to duplicate
Return | Pointer to duplicated string, NULL if error
Description | Similar to strdup 'C' function from stdlib
Comments | VISION will keep track of this allocation and check against leak or memory under/over flows.
VAPI Version | 1.05 or greater

|  | Documentation VISION (VAPI) |  | Last update : 03/28/20
| MEM INTERFACE |