Next: , Previous: , Up: Interpreters And This Library   [Index]


4.2.4 Temporaries

Temporaries are pieces of information reserving resources, created usually on explicit requests and evading general resource management mechanisms. The resources blocked by temporaries (commonly memory, but can include opened files, operating system objects) need to be deallocated, though not until they get out of use.

Temporaries are created by functions returning newly constructed objects (consider a function concatenating two strings and returning the result), by assigning variables (the objects previously referred by the assigned variables may still be in use and they will be bound to temporaries so that their destruction is delayed), etc.

Since temporaries do not submit to regular resource management mechanisms, applications interested in using interfaces that create temporaries need to setup special resource deallocation mechanisms for deallocating the resources blocked by the temporaries.

No mechanism withing the libaime interpreters create temporaries, only application may create temporaries (with respect to the program execution and expression evaluation, libraries, even those provided by libaime, are part of the application).

Applications are expected to either setup for temporaries (eventual) deallocation or otherwise avoid interfaces creating temporaries altogether.

For immediate temporaries deallocation applications may consider step by step program execution. Such program execution mode provides for the opportunity to free the resources blocked by temporaries as soon as they are no longer needed.

See Step By Step Imperative Program Execution.

See Step By Step Procedural Program Execution.

See Temporaries Allocator Construct.

See Temporaries Registration.