Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
 _duma_allocate, _DUMA_Slot
 _DUMA_Allocator
 _duma_allocList, _DUMA_Slot
 _duma_allocListSize, _DUMA_Slot
 _duma_assert, _DUMA_Slot
 _duma_deallocate, _DUMA_Slot
 _DUMA_FailReturn
 _duma_init, _DUMA_Slot
 _DUMA_InitState
 _duma_kmalloc, _DUMA_Slot
 _DUMA_MemRegion
 _DUMA_Slot
 _DUMA_Slot_FileSource
 _DUMA_SlotState
0-9
 00README
A
 allocateMoreSlots, _DUMA_Slot
D
 DUMA_ADDR
 DUMA_ALIGNMENT, _DUMA_Slot
 DUMA_ALLOW_MALLOC_0, _DUMA_Slot
 duma_config.h
 DUMA_FILL, _DUMA_Slot
 DUMA_FREE_ACCESS, _DUMA_Slot
 duma_init, _DUMA_Slot
 duma_init_done, _DUMA_Slot
 DUMA_MALLOC_FAILEXIT, _DUMA_Slot
 DUMA_MAX_ALLOC, _DUMA_Slot
 DUMA_MIN_ALIGNMENT
 DUMA_PAGE_SIZE
 DUMA_PROTECT_BELOW, _DUMA_Slot
 DUMA_PROTECT_FREE, _DUMA_Slot
 DUMA_SHOW_ALLOC, _DUMA_Slot
 DUMA_SIZE
 DUMA_SLACKFILL, _DUMA_Slot
E
 Enumerations
F
 Functions
I
 ilog2
K
 kduma.c
 kduma.h
L
 log.h
M
 MEMORY_CREATION_SIZE
 mprotectFailed
N
 none
 numAllocs, _DUMA_Slot
 numDeallocs, _DUMA_Slot
P
 Page_AllowAccess
 Page_Create
 Page_Delete
 Page_DenyAccess
 Page_Size
 paging.h
S
 slotCount, _DUMA_Slot
 slotsPerPage, _DUMA_Slot
 sumAllocatedMem, _DUMA_Slot
 sumProtectedMem, _DUMA_Slot
 sumTotalAllocatedMem, _DUMA_Slot
T
 Types
U
 unUsedSlots, _DUMA_Slot
V
 Variables
 version
void * _duma_allocate(size_t alignment,
size_t userSize,
int protectBelow,
int fillByte,
int protectAllocList,
enum _DUMA_Allocator allocator,
enum _DUMA_FailReturn fail DUMA_PARAMLIST_FL)
This is the memory allocator.
Passed to duma allocator such as we know who is calling us.
struct _DUMA_Slot * _duma_allocList
_DUMA_allocList points to the array of slot structures used to manage the malloc arena.
static size_t _duma_allocListSize
_duma_allocListSize is the size of the allocation list.
void _duma_assert(const char *exprstr,
const char *filename,
int lineno)
Print message and halt program execution in crazy way.
void _duma_deallocate(void *address,
int protectAllocList,
enum _DUMA_Allocator allocator DUMA_PARAMLIST_FL)
Deallocate allocated memory after running some checks, then open slot for use.
Unknown use.
void _duma_init(void)
_duma_init sets up the memory allocation arena and the run-time configuration information.
Whats are initialization start
void * _duma_kmalloc(size_t size,
int flags DUMA_PARAMLIST_FL)
A version of kmalloc.
Memory region of slot.
Struct Slot contains all of the information about a malloc buffer except for the contents of its memory.
Where did we get file info
State of slot values (empty, free, etc)
This is the begining of a linux kernel model duma.
static void allocateMoreSlots(void)
allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.
An integer type with same size as ‘void *’
size_t DUMA_ALIGNMENT
DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().
static int DUMA_ALLOW_MALLOC_0
DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).
int DUMA_FILL
DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.
static int DUMA_FREE_ACCESS
DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.
void duma_init(void)
duma_init sets configuration settings.
internal variable: state of initialization
static int DUMA_MALLOC_FAILEXIT
DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.
static long DUMA_MAX_ALLOC
DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.
Minimum required alignment by CPU.
Number of bytes per virtual-memory page, as returned by Page_Size().
int DUMA_PROTECT_BELOW
DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.
static long DUMA_PROTECT_FREE
DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().
static int DUMA_SHOW_ALLOC
DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.
An integer type with same size as ‘size_t’
static int DUMA_SLACKFILL
DUMA_SLACKFILL is set to 0-255.
static inline int ilog2(int val)
Base 2 log computation.
MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time.
static void mprotectFailed(void)
Report that VirtualProtect or mprotect failed and abort program execution.
Fake variable to make docs work right :(
static long numAllocs
internal variable: number of allocations processed so far
static long numDeallocs
internal variable: number of deallocations processed so far
void Page_AllowAccess(void *address,
size_t size)
Allow memory access to allocated memory.
static void * Page_Create(size_t size,
int exitonfail,
int printerror,
int flags)
Create memory.
static void Page_Delete(void *address,
size_t size)
Free’s DUMA allocated memory.
static void Page_DenyAccess(void *address,
size_t size)
Deny access to allocated memory region.
static size_t Page_Size(void)
Retrieve page size.
static size_t slotCount
slotCount is the number of Slot structures in allocationList.
static size_t slotsPerPage
slotsPerPage is the number of slot structures that fit in a virtual memory page.
static long sumAllocatedMem
internal variable: sum of allocated -freed +protected memory in kB
static long sumProtectedMem
internal variable: sum of protected memory in kB
static long sumTotalAllocatedMem
internal variable: sum of allocated memory in kB
static size_t unUsedSlots
unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.
static const char version[]
KDUMA version string