libk  Diff

Differences From Artifact [e8670496c8]:

To Artifact [09be45a2b3]:


5
6
7
8
9
10
11





12
13
14
15
16
17
18
..
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
#ifndef KFclean
#	define Kmsz(e) ( sizeof (e) / sizeof (e) [0] )
#endif

#ifdef __cplusplus
extern "C" {
#endif






typedef enum kmkind {
	kmkind_none,
	kmkind_heap,
	kmkind_pool,
	kmkind_ref,
	kmkind_tree
................................................................................

typedef struct kmcell {
	kmkind kind;
	sz size;
	kmshred shred;
	sz refs;
	struct kmcell* src;
	char data[];
} kmcell;

typedef struct kmptr {
	kmkind kind;
	kmshred shred;
	void* ref;
	kmcell* cell;
} kmptr;

/* heap functions */

void* kmheapa(sz);
void  kmheapf(void*);

#ifdef __cplusplus
}
#endif

#endif







>
>
>
>
>







 







<











|
|






5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
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 KFclean
#	define Kmsz(e) ( sizeof (e) / sizeof (e) [0] )
#endif

#ifdef __cplusplus
extern "C" {
#endif

typedef enum kmcond {
	kmcond_ok,
	kmcond_bad_address,
} kmcond;

typedef enum kmkind {
	kmkind_none,
	kmkind_heap,
	kmkind_pool,
	kmkind_ref,
	kmkind_tree
................................................................................

typedef struct kmcell {
	kmkind kind;
	sz size;
	kmshred shred;
	sz refs;
	struct kmcell* src;

} kmcell;

typedef struct kmptr {
	kmkind kind;
	kmshred shred;
	void* ref;
	kmcell* cell;
} kmptr;

/* heap functions */

void*  kmheapa(sz);
kmcond kmheapf(void*);

#ifdef __cplusplus
}
#endif

#endif