|
Serene Runtime 1.0.0
C runtime for the Serene programming language
|
Main memory manager structure that will own all the allocated blocks and data. More...
#include <interface.h>
Data Fields | |
| srn_spinlock_t | lock |
| This spinlock is here to protect the srn_mm_t when allocating/deallocating new blocks. | |
| srn_memory_provider_t * | provider |
| An abstraction over a memory provider like the malloc/free pair. | |
| uint64_t | block_bitmap [4] |
| This is a 256bit bitmap we treat it as a whole. | |
| size_t | block_size |
| size_t | block_count |
| srn_block_t * | blocks [MAX_NUMBER_OF_BLOCKS] |
| srn_block_t * | immortal_block |
| Immortal block is a chain of blocks which will never die. | |
Main memory manager structure that will own all the allocated blocks and data.
In every instance of the compiler there should be only one instance of this. It should be created via srn_mm_init and destroyed via srn_shutdown_memory_manager.
Definition at line 112 of file interface.h.
| uint64_t srn_mm_t::block_bitmap[4] |
This is a 256bit bitmap we treat it as a whole.
1 means that bit position in the blocks array is occupied for allocation. otherwise it is free.
Definition at line 126 of file interface.h.
| size_t srn_mm_t::block_count |
Definition at line 128 of file interface.h.
| size_t srn_mm_t::block_size |
Definition at line 127 of file interface.h.
| srn_block_t* srn_mm_t::blocks[MAX_NUMBER_OF_BLOCKS] |
Definition at line 129 of file interface.h.
| srn_block_t* srn_mm_t::immortal_block |
Immortal block is a chain of blocks which will never die.
We will free the chain at exit. it is there to allocate objects that will be around for the duration of the program.
Definition at line 134 of file interface.h.
| srn_spinlock_t srn_mm_t::lock |
This spinlock is here to protect the srn_mm_t when allocating/deallocating new blocks.
It is NOT used to protect blocks themselves. For block level operations we use a block level spinlock
Definition at line 119 of file interface.h.
| srn_memory_provider_t* srn_mm_t::provider |
An abstraction over a memory provider like the malloc/free pair.
Definition at line 122 of file interface.h.