f1ec85e2d667485e39e232bdb85391de1b225304
[cacao.git] / mm / bitmap2.h
1 /* 
2  * cacao/mm/bitmap.h
3  * $Id: bitmap2.h 93 1998-11-25 11:49:36Z phil $ 
4  */
5
6 #ifndef __mm_bitmap_h_
7 #define __mm_bitmap_h_
8
9 #include "mm.h"
10
11 #if U8_AVAILABLE
12 #   define BITBLOCK             u8
13 #       define OFFSET_T         u8
14 #else
15 #       define BITBLOCK         u4
16 #       define OFFSET_T         u4
17 #endif
18
19 typedef struct {
20         BITBLOCK*           bitmap;                     /* accessor, usually copied */
21         unsigned long   bytesize;       /* used internally */
22         void*           bitmap_beyond_addr;
23         OFFSET_T                bitmap_top_block;
24         void*           bitmap_memory;  /* internal: the real address */
25 } bitmap_t;
26
27 __inline__ void       bitmap_setbit(BITBLOCK* bitmap, void* addr);
28 __inline__ void       bitmap_clearbit(BITBLOCK* bitmap, void* addr);
29 __inline__ bool       bitmap_testbit(BITBLOCK* bitmap, void* addr);
30
31 __inline__ void       bitmap_checking_setbit(bitmap_t* bitmap, void* addr);
32 __inline__ void       bitmap_checking_clearbit(bitmap_t* bitmap, void* addr);
33 __inline__ bool       bitmap_checking_testbit(bitmap_t* bitmap, void* addr);
34
35 __inline__ void       bitmap_clear(bitmap_t* bitmap);
36 __inline__ bitmap_t*  bitmap_allocate(void* zero_offset, OFFSET_T size);
37 __inline__ void       bitmap_release(bitmap_t* bitmap);
38
39 __inline__ void*      bitmap_find_next_setbit(bitmap_t* bitmap, void* addr);
40 __inline__ void*      bitmap_find_next_combination_set_unset(bitmap_t* bitmap, bitmap_t* invertedmap, void* addr);
41
42 __inline__ void       bitmap_mask_with_bitmap(bitmap_t* bitmap, bitmap_t* mask);
43 #endif
44
45 /*
46  * These are local overrides for various environment variables in Emacs.
47  * Please do not remove this and leave it at the end of the file, where
48  * Emacs will automagically detect them.
49  * ---------------------------------------------------------------------
50  * Local variables:
51  * mode: c
52  * indent-tabs-mode: t
53  * c-basic-offset: 4
54  * tab-width: 4
55  * End:
56  */
57
58
59
60