clang-format

This commit is contained in:
2024-09-10 13:03:02 -04:00
parent 53c617d779
commit d66450e427
381 changed files with 28864 additions and 34170 deletions

View File

@@ -29,26 +29,24 @@
*/
struct poolctl {
uint32_t *inuse;
unsigned max;
const char *itemtype;
const char *maxname;
const char *file;
uint32_t *inuse;
unsigned max;
const char *itemtype;
const char *maxname;
const char *file;
};
#define DIVROUNDUP(a, b) (((a) + (b) - 1) / (b))
#define ROUNDUP(a, b) (DIVROUNDUP(a, b) * (b))
#define DIVROUNDUP(a, b) (((a) + (b) - 1) / (b))
#define ROUNDUP(a, b) (DIVROUNDUP(a, b) * (b))
#define DECLPOOL(T, MAX) \
static struct T pool_space_##T[ROUNDUP(MAX, 32)]; \
static uint32_t pool_inuse_##T[DIVROUNDUP(MAX, 32)]; \
static struct poolctl pool_##T = { \
.inuse = pool_inuse_##T, \
.max = ROUNDUP(MAX, 32), \
.itemtype = "struct " #T, \
.maxname = #MAX, \
.file = __FILE__ \
}
#define DECLPOOL(T, MAX) \
static struct T pool_space_##T[ROUNDUP(MAX, 32)]; \
static uint32_t pool_inuse_##T[DIVROUNDUP(MAX, 32)]; \
static struct poolctl pool_##T = {.inuse = pool_inuse_##T, \
.max = ROUNDUP(MAX, 32), \
.itemtype = "struct " #T, \
.maxname = #MAX, \
.file = __FILE__}
#define POOLALLOC(T) (&pool_space_##T[poolalloc(&pool_##T)])
#define POOLFREE(T, x) (poolfree(&pool_##T, (x) - pool_space_##T))