AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database

About the Dynamite heap

Block IDs


When you allocate a block using Dynamite_Alloc, you can specify a block ID to associate with it.  This can be any 32-bit value you like, although it should be something unlikely to conflict with other client's IDs, e.g.:

     ·     A modules base address
     ·     An application's task handle or start time

If you want your program to have multiple IDs, you could divide the ID value into a magic field (say 24 bits of module base address) and an index number.

Later, you can free all blocks with a particular ID.  This is useful when you want to free all the blocks associated with a particular object when that object is destroyed.  For example, during development of a module, you could free all its Dynamite blocks in the finalisation code.

[sh-index] Back to list of manuals