From 8bec6205ae1631dc0896fe25795b2946ed414df0 Mon Sep 17 00:00:00 2001 From: steven-na Date: Tue, 28 Jul 2026 02:12:54 -0700 Subject: Arenas and start work on strings --- src/common.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/common.h (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..1add4db --- /dev/null +++ b/src/common.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include + +#define KiB(n) ((u64)n<<10) +#define MiB(n) ((u64)n<<20) +#define GiB(n) ((u64)n<<30) + +#define MAX(n, m) ((n > m) ? (n) : (m)) +#define MIN(n, m) ((n < m) ? (n) : (m)) +#define ALIGN_UP_POW2(n, m) (((u64)(n) + (u64)(m) - 1) & (~((u64)(m) - 1))) + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef i8 b8; +typedef i32 b32; + +typedef float f32; +typedef double f64; + +#define ARENA_ALIGN (sizeof(void*)) -- cgit v1.2.3