-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitmap.h
55 lines (42 loc) · 1.18 KB
/
bitmap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _BITMAP_H__
#define _BITMAP_H__
#include "mb_node.h"
#include "mm.h"
//Node Type
#define LEAF_NODE 0
#define MID_NODE 1
//Traverse continue
#define TRAVERSE_CONT 1
struct trace{
struct mb_node *node;
uint32_t pos;
};
struct lazy_travel {
struct mb_node *lazy_p;
uint32_t stride;
};
int update_nodes(struct mm *mm, struct trace *t, int total, struct rollback_stash *stash);
typedef int (*traverse_func) (struct mb_node *node,
uint8_t stride, uint8_t pos, uint8_t type, void *data);
int prefix_exist_func(struct mb_node *node,
uint8_t stride, uint8_t pos, uint8_t type, void *data);
typedef struct aux_queue_elem{
struct mb_node *n;
int len;
} aux_elem_t;
typedef struct aux_queue {
int head;
int tail;
int cap;
aux_elem_t *ptrs;
} aux_queue_t;
int aux_queue_init(aux_queue_t *q, int cap);
int aux_queue_len(aux_queue_t *q);
void aux_queue_shrink(aux_queue_t *q);
int aux_queue_full(aux_queue_t *q);
int aux_queue_put(aux_queue_t *q, aux_elem_t *p);
int aux_queue_empty(aux_queue_t *q);
void aux_queue_get(aux_queue_t *q, aux_elem_t **p);
aux_elem_t *aux_queue_head(aux_queue_t *q);
int aux_queue_dctor(aux_queue_t *q);
#endif