15 FILE *file = fopen(filename,
"rb");
16 fseek(file, 0, SEEK_END);
21 byte *buffer = allocator_alloc_ty(
byte, allocator, *size);
22 fread(buffer,
sizeof(
byte), *size, file);
32 FILE *file = fopen(filename,
"r");
33 fseek(file, 0, SEEK_END);
35 sz size = ftell(file);
38 char *buffer = allocator_alloc_ty(
char, allocator, size + 1);
39 fread(buffer,
sizeof(
char), size, file);
47 return seed ^ (value + 0x9e3779b97f4a7c15 + (seed << 6) + (seed >> 2));
55 o ^= 0x9e3779b97f4a7c15 + (a << 6) + (a >> 2);
uint64_t u64
Definition defs.h:46
#define ASSERT__(expr)
Definition defs.h:21
size_t sz
Definition defs.h:51
static u64 hash_combine_com_u64(u64 a, u64 b)
Definition misc.h:51
static u64 hash_combine_u64(u64 seed, u64 value)
Definition misc.h:46
static void * read_binary_file(allocator_t allocator, const char *filename, sz *size)
Read a binary file file of into memory.
Definition misc.h:9
static char * read_text_file(allocator_t allocator, const char *filename)
Definition misc.h:28
A generic allocator type passed by value. Contains a fallback allocator and a set of function pointer...
Definition memory.h:30