Module runtime::memories::frag

source ·
Expand description

This module provides functionality to allocate memory with higher randomness on returned addresses.

The most simple approach is to allocate memory multiple times, return the final allocation as the desired memory.

Allocators differ between operating systems. On *nix and BSD-based systems malloc(int) is being called but does not initialize the allocated spaced. Microsoft Windows uses VirtualAlloc allocates and initializes a region of memory pages with zeroes.

FragStrategy implements at least two possible allocation strategies:

  • Direct: The algorithm tries to allocate a huge amount of memory space while keeping a certain address distance
  • Memory Mapped: anonymous memory is being mapping, the memory address will be randomly selected.

Structs

Frag is being used as control object to load different allocators according to their strategy
Configuration for the fragmenting allocator

Enums

Fragmenting strategy to allocate memory at random addresses.

Statics

Traits

Custom allocator trait

Functions

Rounds value up to a multiple of base