Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.42 KB

introspection.rst

File metadata and controls

39 lines (29 loc) · 1.42 KB

Introspection

When writing code to run on computers with a complex memory hierarchy, one of the most difficult things can be keeping track of where each pointer has been allocated. Umpire's instrospection capability keeps track of this information, as well as other useful bits and pieces you might want to know.

The umpire::ResourceManager can be used to find the allocator associated with an address:

../../../examples/tutorial/tut_introspection.cpp

Once you have this, it's easy to query things like the name of the Allocator or find out the associated umpire::Platform, which can help you decide where to operate on this data:

../../../examples/tutorial/tut_introspection.cpp

You can also find out how big the allocation is, in case you forgot:

../../../examples/tutorial/tut_introspection.cpp

Remember that these functions will work on any allocation made using an Allocator or umpire::TypedAllocator.

../../../examples/tutorial/tut_introspection.cpp