An allocation allocates memory for a variable. The amount of memory allocated is sufficient to hold all values of the variable type.
The allocation operator is documented as a structural operator.
Manual memory management
The Progsbase system has manual memory management, and does not assume garbage collection. It does support garbage collected targets, but the deallocation must still be in the program. For languages that does not support manual deallocation, the deallocation lines will not do anything.
Recommended practises of memory management
The Progsbase system guarantees that a sequence of lines on the same nesting level are all executed in order. In many programming languages, this is not the case. The usual mechanisms are
break within loops, multiple
returns in a function, and using exceptions for control flow. There are no such constructs in the ProgsBase system. This ensures that if a sequence of lines within a function has the same nesting level, they are guaranteed be executed and they will garantueed be executed in that order.
Memory management within a function
If a function needs some amount of memory to do its work, then the memory can be allocated and deallocated on the same nesting level. This ensures that both the allocation and the deallocation will happen, and happen in that order.
Sub allocation within a function
If a complex data structure needs to be allocated, it can be allocated inside a loop or inside another function. The same practise still applies, but the allocation and deallocation are more complex and is itself nested.
Memory management across functions
If a function returns allocated memory, then the function can itself be seen as an allocation function. The calling function then has the responsibility of deallocating the memory, and this can follow the practise of either memory management within a function or memory management across functions.