ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
multi.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include <datatypes/array.h>
12 
13 #include <assert.h>
14 #include <stdalign.h>
15 #include <stddef.h>
16 #include <stdint.h>
17 
19 struct mm_checkpoint {
21  uint_fast32_t ckpt_size;
23  unsigned char chkps[];
24 };
25 
27 struct mm_log {
31  struct mm_checkpoint *c;
32 };
33 
35 struct mm_state {
37  dyn_array(struct buddy_state *) buddies;
39  dyn_array(struct mm_log) logs;
41  uint_fast32_t full_ckpt_size;
42 };
43 
Dynamic array datatype.
uint_least32_t array_count_t
The type used to handle dynamic arrays count of elements and capacity.
Definition: array.h:21
The checkpointable memory context of a single buddy system.
Definition: buddy.h:30
The checkpoint for the multiple buddy system allocator.
Definition: multi.h:19
uint_fast32_t ckpt_size
The total count of allocated bytes at the moment of the checkpoint.
Definition: multi.h:21
unsigned char chkps[]
The sequence of checkpoints of the allocated buddy systems (see buddy_checkpoint)
Definition: multi.h:23
Binds a checkpoint together with a reference index.
Definition: multi.h:27
array_count_t ref_i
The reference index, used to identify this checkpoint.
Definition: multi.h:29
struct mm_checkpoint * c
A pointer to the actual checkpoint.
Definition: multi.h:31
The checkpointable memory context assigned to a single LP.
Definition: multi.h:35
uint_fast32_t full_ckpt_size
The total count of allocated bytes.
Definition: multi.h:41
dyn_array(struct mm_log) logs
The array of checkpoints.
dyn_array(struct buddy_state *) buddies
The array of pointers to the allocated buddy systems for the LP.