|
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 |
| -#define BYTES_PER_BITMAP sizeof(bitmap_t) |
| 100 | +#if defined(__LP64__) |
| 101 | +#define BYTES_PER_BITMAP 8 |
| 102 | +#else |
| 103 | +#define BYTES_PER_BITMAP 4 |
| 104 | +#endif |
101 | 105 |
|
102 | 106 | #define BITMAP_C(v) ((bitmap_t)(v))
|
103 | 107 | #define BITMAP_ALL_ONES (~BITMAP_C(0))
|
104 | 108 |
|
105 | 109 | // Stop configuring.
|
106 | 110 |
|
107 |
| -#define CONTINUATIONS_PER_BITMAP (BYTES_PER_BITMAP * CHAR_BIT) |
108 |
| -#define BITMAPS_PER_SUPERMAP (BYTES_PER_SUPERMAP * CHAR_BIT) |
| 111 | +#define CONTINUATIONS_PER_BITMAP (BYTES_PER_BITMAP * 8) |
| 112 | +#define BITMAPS_PER_SUPERMAP (BYTES_PER_SUPERMAP * 8) |
109 | 113 |
|
110 | 114 | #define BYTES_PER_MAGAZINE (PAGES_PER_MAGAZINE * DISPATCH_ALLOCATOR_PAGE_SIZE)
|
111 | 115 | #define CONSUMED_BYTES_PER_BITMAP (BYTES_PER_BITMAP + \
|
112 | 116 | (DISPATCH_CONTINUATION_SIZE * CONTINUATIONS_PER_BITMAP))
|
113 | 117 |
|
114 |
| -#define BYTES_PER_SUPERMAP sizeof(bitmap_t) |
| 118 | +#define BYTES_PER_SUPERMAP BYTES_PER_BITMAP |
115 | 119 | #define CONSUMED_BYTES_PER_SUPERMAP (BYTES_PER_SUPERMAP + \
|
116 | 120 | (BITMAPS_PER_SUPERMAP * CONSUMED_BYTES_PER_BITMAP))
|
117 | 121 |
|
@@ -143,7 +147,11 @@ typedef unsigned long bitmap_t;
|
143 | 147 |
|
144 | 148 | #define PADDING_TO_CONTINUATION_SIZE(x) (ROUND_UP_TO_CONTINUATION_SIZE(x) - (x))
|
145 | 149 |
|
146 |
| -#define SIZEOF_HEADER (sizeof(struct dispatch_magazine_header_s)) |
| 150 | +#if defined(__LP64__) |
| 151 | +#define SIZEOF_HEADER 16 |
| 152 | +#else |
| 153 | +#define SIZEOF_HEADER 8 |
| 154 | +#endif |
147 | 155 |
|
148 | 156 | #define SIZEOF_SUPERMAPS (BYTES_PER_SUPERMAP * SUPERMAPS_PER_MAGAZINE)
|
149 | 157 | #define SIZEOF_MAPS (BYTES_PER_BITMAP * BITMAPS_PER_SUPERMAP * \
|
|
0 commit comments