MemoryManagerMacros

Exports convenience macros for accessing mm_maincontext.

Summary
MemoryManagerMacrosExports convenience macros for accessing mm_maincontext.
CopyrightThis program is free software.
Files
C-kern/api/memory/mm/mm_macros.hHeader file MemoryManagerMacros.
Functions
query
SIZEALLOCATED_MMREturns number of allocated bytes.
allocate
ALLOC_MMAllocates a new memory block.
RESIZE_MMResizes memory block.
FREE_MMFrees memory block.

Copyright

This program is free software.  You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Author

© 2012 Jörg Seebohn

Files

C-kern/api/memory/mm/mm_macros.h

Header file MemoryManagerMacros.

Functions

Summary
query
SIZEALLOCATED_MMREturns number of allocated bytes.
allocate
ALLOC_MMAllocates a new memory block.
RESIZE_MMResizes memory block.
FREE_MMFrees memory block.

query

SIZEALLOCATED_MM

#define SIZEALLOCATED_MM() sizeallocated_mm(mm_maincontext())

REturns number of allocated bytes.  See also <sizeallocated_mmimpl>.

allocate

ALLOC_MM

#define ALLOC_MM(size,
mblock) malloc_mm(mm_maincontext(), size, mblock)

Allocates a new memory block.  See also <malloc_mmimpl>.

RESIZE_MM

#define RESIZE_MM(newsize,
mblock) mresize_mm(mm_maincontext(), newsize, mblock)

Resizes memory block.  See also <mresize_mmimpl>.

FREE_MM

#define FREE_MM(mblock) mfree_mm(mm_maincontext(), mblock)

Frees memory block.  See also <mfree_mmimpl>.

#define mm_maincontext() (tcontext_maincontext()->mm)
Inline implementation of maincontext_t.mm_maincontext.
Exports convenience macros for accessing mm_maincontext.
#define SIZEALLOCATED_MM() sizeallocated_mm(mm_maincontext())
REturns number of allocated bytes.
#define ALLOC_MM(size,
mblock) malloc_mm(mm_maincontext(), size, mblock)
Allocates a new memory block.
#define RESIZE_MM(newsize,
mblock) mresize_mm(mm_maincontext(), newsize, mblock)
Resizes memory block.
#define FREE_MM(mblock) mfree_mm(mm_maincontext(), mblock)
Frees memory block.
Close