dr_custom_alloc

Function dr_custom_alloc 

Source
pub unsafe extern "C" fn dr_custom_alloc(
    drcontext: *mut c_void,
    flags: dr_alloc_flags_t,
    size: usize,
    prot: uint,
    addr: *mut c_void,
) -> *mut c_void
Expand description

Allocates memory with the properties requested by \p flags.

If \p addr is non-NULL (only allowed with certain flags), it must be page-aligned.

To make more space available for the code caches when running larger applications, or for clients that use a lot of heap memory that is not directly referenced from the cache, we recommend that dr_custom_alloc() be called to obtain memory that is not guaranteed to be reachable from the code cache (by not passing #DR_ALLOC_CACHE_REACHABLE). This frees up space in the reachable region.

Returns NULL on failure.