Memory Block Attributes

Get familiarized with the memory block attributes.

We'll cover the following

The concepts and the steps of a GC algorithm can be configured to some degree for each memory block by enum BlkAttr. BlkAttr is an optional parameter of GC.calloc and other allocation functions. It consists of the following values:

  • NONE: The value zero; specifies no attribute

  • FINALIZE: Specifies that the objects that live in the memory block should be finalized

Normally, the GC assumes that the lifetimes of objects that live on explicitly- allocated memory locations are under the control of the programmer; it does not finalize objects on such memory areas. GC.BlkAttr.FINALIZE is for requesting the GC to execute the destructors of objects:

Get hands-on with 1200+ tech skills courses.