regions.h - mhahnFr/CallstackLibrary GitHub Wiki
This header defines the functionality to examine the global and thread-local memory regions of the loaded binary files.
struct region
Defines a memory region.
Contains the beginning and end pointers of the memory region as well as the name of the binary file to which the memory
region belongs to.
[!NOTE] Added in version 2.2.
uintptr_t begin
The beginning pointer of the represented memory region.
uintptr_t end
The end pointer of the represented memory region.
const char* name
The name of the binary file this memory region belongs to.
const char* nameRelative
The name of the binary file this memory region belongs to, relative to the current working directory.
struct regionInfo
Defines an array of memory region structures.
[!NOTE] Added in version 2.2.
struct region* regions
The wrapped array of region information structures.
size_t amount
The amount of region information structures in this array.
struct regionInfo regions_getLoadedRegions(void)
Returns an array containing the global memory region information structures of all currently loaded runtime images.
These memory regions represent the locations global storage is possibly found in.
The returned array must be destructed after usage with the function regions_destroyInfo.
If callstack_autoClearCaches is true, the binary file names point into the cache of the library.
[!NOTE] Added in version 2.2.
struct regionInfo regions_getTLSRegions(void)
Returns an array containing the thread-local memory region information structures of all currently loaded runtime images.
They represent the locations thread-local storage is found for the calling thread.
The returned array must be destructed after usage using the function regions_destroyInfo.
If callstack_autoClearCaches is true, the binary file names point into the cache of the library.
[!WARNING] Since thread-local storage generally is initialized on demand, calling this function may result in initializing all thread-local variables for the calling thread, including system defined variables.
[!NOTE] Added in version 2.2.
void regions_destroyInfo(const struct regionInfo* info)
Destroys the given region information structures array.
[!NOTE] Added in version 2.2.