Consultor Eletrônico



Kbase P18102: Static Objects Explained
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   19/04/2005
Status: Unverified

GOAL:

Static Objects Explained

FACT(s) (Environment):

Progress 9.1x
OpenEdge 10.x

FIX:

Static Objects.
A static object is non-moving. That is, a memory manager does not relocate it; its address does not change.
They are bound at compile time. We know about them when the program starts executing.
Memory is garbage collected when the procedure.p terminates.
Example:
FOR EACH CUSTOMER:
DISPLAY CUSTOMER.CUSTNUM CUSTOMER.NAME.
END.

Garbage collection (GC), also known as automatic memory management, is the automatic recycling of dynamically allocated memory. Garbage collection is performed by a garbage collector which recycles memory that it can prove will never be used again. Systems and languages, which use garbage collection, can be described as garbage-collected.

Handles to Static Objects.
Handle Memory de-allocated when static object goes out of scope. It is not necessary to delete objects on these.
Example:
DEFINE VARIABLE HCUST AS HANDLE NO-UNDO.
HCUST = BUFFER CUSTOMER:HANDLE
FOR EACH CUSTOMER:
DISPLAY CUSTOMER.CUSTNUM CUSTOMER.NAME.
END.