Vely logo Empower C
install     tutorials     examples     documentation     license     about

11.0.11 released on Jul 25, 2022

Memory handling



DESCRIPTION:


Vely memory allocation is tracked and automatically released at the end of a request. This includes any memory allocated by Vely itself and any memory allocated by Vely language_statements, even if memory is no longer accessible to program, thus preventing memory leaks; this is important for stability of long-running processes. Memory needed for cross-request purposes, such as prepared database statements or process configuration data, is kept for the life of the process.

Any of the Vely language_statements that returns newly allocated memory will always create new memory. In other words, if you use variable "result" (that has already been allocated by another statement) to hold the result, the previously allocated memory for it will be ignored, and new memory allocated, meaning Vely will not attempt to reallocate memory. The reason for this is to reduce errors and fatal crashes that may result from passing non-Vely allocated pointers, or bad pointers. This will not create a memory leak because Vely keeps track of all such allocated memory and all of it will be deallocated at the end of the request. If you allocate large amounts of memory in a loop, you can always delete it (using delete-mem), but in general that is rarely needed.

SEE ALSO:


Memory ( memory_handling   new-mem   resize-mem   delete-mem  )  SEE ALL (documentation)



Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. This web page is licensed under CC-BY-SA-4.0.