|
97 | 97 | // Use the largest type your platform is comfortable doing atomic ops with.
|
98 | 98 | // TODO: rdar://11477843
|
99 | 99 | typedef unsigned long bitmap_t;
|
100 |
| -#if defined(__LP64__) |
101 |
| -#define BYTES_PER_BITMAP 8 |
102 |
| -#else |
103 |
| -#define BYTES_PER_BITMAP 4 |
104 |
| -#endif |
| 100 | +#define BYTES_PER_BITMAP sizeof(bitmap_t) |
105 | 101 |
|
106 | 102 | #define BITMAP_C(v) ((bitmap_t)(v))
|
107 | 103 | #define BITMAP_ALL_ONES (~BITMAP_C(0))
|
108 | 104 |
|
109 | 105 | // Stop configuring.
|
110 | 106 |
|
111 |
| -#define CONTINUATIONS_PER_BITMAP (BYTES_PER_BITMAP * 8) |
112 |
| -#define BITMAPS_PER_SUPERMAP (BYTES_PER_SUPERMAP * 8) |
| 107 | +#define CONTINUATIONS_PER_BITMAP (BYTES_PER_BITMAP * CHAR_BIT) |
| 108 | +#define BITMAPS_PER_SUPERMAP (BYTES_PER_SUPERMAP * CHAR_BIT) |
113 | 109 |
|
114 | 110 | #define BYTES_PER_MAGAZINE (PAGES_PER_MAGAZINE * DISPATCH_ALLOCATOR_PAGE_SIZE)
|
115 | 111 | #define CONSUMED_BYTES_PER_BITMAP (BYTES_PER_BITMAP + \
|
116 | 112 | (DISPATCH_CONTINUATION_SIZE * CONTINUATIONS_PER_BITMAP))
|
117 | 113 |
|
118 |
| -#define BYTES_PER_SUPERMAP BYTES_PER_BITMAP |
| 114 | +#define BYTES_PER_SUPERMAP sizeof(bitmap_t) |
119 | 115 | #define CONSUMED_BYTES_PER_SUPERMAP (BYTES_PER_SUPERMAP + \
|
120 | 116 | (BITMAPS_PER_SUPERMAP * CONSUMED_BYTES_PER_BITMAP))
|
121 | 117 |
|
@@ -147,11 +143,7 @@ typedef unsigned long bitmap_t;
|
147 | 143 |
|
148 | 144 | #define PADDING_TO_CONTINUATION_SIZE(x) (ROUND_UP_TO_CONTINUATION_SIZE(x) - (x))
|
149 | 145 |
|
150 |
| -#if defined(__LP64__) |
151 |
| -#define SIZEOF_HEADER 16 |
152 |
| -#else |
153 |
| -#define SIZEOF_HEADER 8 |
154 |
| -#endif |
| 146 | +#define SIZEOF_HEADER (sizeof(struct dispatch_magazine_header_s)) |
155 | 147 |
|
156 | 148 | #define SIZEOF_SUPERMAPS (BYTES_PER_SUPERMAP * SUPERMAPS_PER_MAGAZINE)
|
157 | 149 | #define SIZEOF_MAPS (BYTES_PER_BITMAP * BITMAPS_PER_SUPERMAP * \
|
|
0 commit comments