Skip to content

regions.h

mhahnFr edited this page Jun 27, 2025 · 2 revisions

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.

Clone this wiki locally