![]() |
Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
|
Go to the source code of this file.
Data Structures | |
struct | arch_alloc_inner_s |
Macros | |
#define | MALLOC_INSPECT_ALL 1 |
#define | ONLY_MSPACES 1 |
#define | USE_SPIN_LOCKS 1 |
#define | MSPACES 1 |
#define | HAVE_MMAP 1 |
#define | BIT_ALLOCATOR_BLOCK (4096ul) |
#define | BIT_ALLOCATOR_BLOCK_MASK (BIT_ALLOCATOR_BLOCK - 1) |
#define | BITS_PER_PAGE (BIT_ALLOCATOR_BLOCK * 8ul) |
Functions | |
int | arch_alloc_init_once (arch_alloc_s *_alloc, size_t size) |
void | arch_alloc_init_always (arch_alloc_s *alloc) |
void * | arch_alloc_allocate (arch_alloc_s *_alloc, size_t size) |
void | _arch_alloc_free (arch_alloc_s *_alloc, void *mem) |
void | arch_alloc_exit (arch_alloc_s *_alloc) |
static void | _arch_alloc_mspace_mallinfo (mspace *mspace, arch_alloc_stats_s *stats) |
arch_alloc_stats_s | arch_alloc_stats (arch_alloc_s *_alloc) |
void | arch_alloc_inspect (arch_alloc_s *_alloc, void(*inspector)(void *start, void *end, size_t size, void *arg), void *arg) |
void * | arax_mmap (size_t s) |
void * | arax_ummap (void *a, size_t s) |
arch_alloc_s * | arch_alloc_create_sub_alloc (arch_alloc_s *parent) |
utils_bitmap_s * | arch_alloc_get_bitmap () |
Variables | |
static struct arch_alloc_inner_s * | global_alloc |
#define BIT_ALLOCATOR_BLOCK (4096ul) |
Definition at line 20 of file dlmalloc/alloc.c.
Referenced by arax_mmap(), arax_ummap(), and arch_alloc_init_once().
#define BIT_ALLOCATOR_BLOCK_MASK (BIT_ALLOCATOR_BLOCK - 1) |
Definition at line 21 of file dlmalloc/alloc.c.
Referenced by arax_mmap(), and arch_alloc_init_once().
#define BITS_PER_PAGE (BIT_ALLOCATOR_BLOCK * 8ul) |
Definition at line 22 of file dlmalloc/alloc.c.
Referenced by arch_alloc_init_once().
#define HAVE_MMAP 1 |
Definition at line 9 of file dlmalloc/alloc.c.
Referenced by sys_alloc(), and sys_trim().
#define MALLOC_INSPECT_ALL 1 |
Definition at line 4 of file dlmalloc/alloc.c.
#define MSPACES 1 |
Definition at line 8 of file dlmalloc/alloc.c.
#define ONLY_MSPACES 1 |
Definition at line 6 of file dlmalloc/alloc.c.
#define USE_SPIN_LOCKS 1 |
Definition at line 7 of file dlmalloc/alloc.c.
void _arch_alloc_free | ( | arch_alloc_s * | _alloc, |
void * | mem ) |
Definition at line 83 of file dlmalloc/alloc.c.
|
static |
Definition at line 109 of file dlmalloc/alloc.c.
References mallinfo::arena, arch_alloc_stats_s::total_bytes, mallinfo::uordblks, and arch_alloc_stats_s::used_bytes.
Referenced by arch_alloc_stats().
void * arax_mmap | ( | size_t | s | ) |
Allocate enough pages(4096 bytes) to hold s
bytes.
s | Number of bytes requested (has to be multiple of BIT_ALLOCATOR_BLOCK) |
Definition at line 143 of file dlmalloc/alloc.c.
void * arax_ummap | ( | void * | a, |
size_t | s ) |
Release the pages starting from a
and ending after bytes
a | Pointer returned from a call of arax_mmap() . |
s | Number of bytes to be freed (has to be multiple of BIT_ALLOCATOR_BLOCK) |
Definition at line 154 of file dlmalloc/alloc.c.
void * arch_alloc_allocate | ( | arch_alloc_s * | alloc, |
size_t | size ) |
Allocate contiguous memory from the alloc arch_alloc_s instance.
alloc | An initialized arch_alloc_s instance. |
size | The size of the allocation. |
Definition at line 62 of file dlmalloc/alloc.c.
Referenced by arch_alloc_create_sub_alloc().
arch_alloc_s * arch_alloc_create_sub_alloc | ( | arch_alloc_s * | parent | ) |
Create a sub-allocator.
This allocator user the same global bitmap for requesting bulk allocations, but maintains separate metadata from the 'global' allocator.
Use arch_alloc_free()
, arch_alloc_allocate()
to alloc/free memory.
Returned allocator should be eventually released by calling arch_alloc_exit()
parent | allocator |
Definition at line 163 of file dlmalloc/alloc.c.
void arch_alloc_exit | ( | arch_alloc_s * | alloc | ) |
Release any resources claimed by the alloc arch_alloc_s instance.
Definition at line 102 of file dlmalloc/alloc.c.
utils_bitmap_s * arch_alloc_get_bitmap | ( | ) |
Definition at line 172 of file dlmalloc/alloc.c.
void arch_alloc_init_always | ( | arch_alloc_s * | alloc | ) |
Perform necessary initialization for every arax application.
arch_alloc_init_once
alloc |
Definition at line 57 of file dlmalloc/alloc.c.
int arch_alloc_init_once | ( | arch_alloc_s * | alloc, |
size_t | size ) |
Initialize a arch_alloc_s instance on a mapped shared memory segment.
alloc | Pointer to be filled with initialized instance. |
size | The size of the shared memory segment in bytes. |
Definition at line 27 of file dlmalloc/alloc.c.
void arch_alloc_inspect | ( | arch_alloc_s * | _alloc, |
void(* | inspector )(void *start, void *end, size_t size, void *arg), | ||
void * | arg ) |
Definition at line 135 of file dlmalloc/alloc.c.
arch_alloc_stats_s arch_alloc_stats | ( | arch_alloc_s * | _alloc | ) |
Definition at line 117 of file dlmalloc/alloc.c.
|
static |
Definition at line 25 of file dlmalloc/alloc.c.
Referenced by arax_mmap(), arax_ummap(), arch_alloc_get_bitmap(), arch_alloc_init_always(), and arch_alloc_init_once().