Skip to main content

freeMemory

Short summary​

This method is used to free allocated memory if needed

Parameters​

NameTypeCommentKind
stringAddressPOINTER TO BYTEstart address of the memory to freeinput
freeAllocatedMemoryBOOLTRUE means free the memory, FALSE means do not free the memoryinput

Code​

Declaration​

METHOD PROTECTED freeMemory
VAR_INPUT
(* start address of the memory to free *)
stringAddress :POINTER TO BYTE;
(* ``TRUE`` means free the memory, ``FALSE`` means do not free the memory *)
freeAllocatedMemory :BOOL;
END_VAR

Implementation​

IF (freeAllocatedMemory) THEN
__DELETE(stringAddress);
END_IF