Purge
ThePurgemethod releases any unneeded memory during low-memory situations.
ODSize Purge (in ODSize size);
size- The number of bytes needed by OpenDoc, expressed as an unsigned 32-bit value.
- return value
- The number of bytes that were released by this object.
DISCUSSION
Your part may call this method, but in general, OpenDoc calls this method in low-memory situations to free any caches, noncritical buffers, or objects; you should not allocate memory for this operation.Because the
ODObjectclass does not allocate (or deallocate) any memory, it always returns the value 0.OVERRIDING
Every subclass ofODObjectcan override this method and should do so if it creates caches and temporary buffers. Your subclass ofODPartmust override this method or risk running out of available memory. Your override method must call its inheritedPurgemethod at some point in your implementation (it does not matter where). You should save the size value returned by the inheritedPurgemethod, and then add it to the size value returned by your override method to determine the amount of memory actually released.SEE ALSO
TheODPartclass (page 459).
"The Purge Method" on page 115 in OpenDoc Cookbook.
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Reference-Counted Objects" on page 468 in OpenDoc Programmer's Guide.
"Purging" on page 472 in OpenDoc Programmer's Guide.