Minor optimisations and bug fixes

Fix bug in mt_mpmc.c, in Linux mutexes are not recursive.
Add arena_trim_string() to the arena API
Removing arena->path, now paths are pushed to arena->metadata
Replacing fe->owner[128] with char *owner; the owner is not pushed as a
string to arena->metadata and trimed with arena_trim_string()
Improving cache locality in arena->metadata, the memory layout is not
fe; fe->path; fe->owner.
Cache aligning all arenas except HasherContext->arena to sizeof(void *).
Pushing elements one by one instead of snprintf() in finalize_file() and
hash_worker().
Getting the full path of current directory instead of "."
Fixing bug in path formating, this allow us to remove normalize_path()
from the hot loop.
This commit is contained in:
2026-05-08 15:45:57 +01:00
parent 7d2a24d0be
commit 16c6aeae65
8 changed files with 352 additions and 160 deletions

5
base.h
View File

@@ -35,6 +35,8 @@
#include <sys/stat.h>
#include <sys/vfs.h>
#include <unistd.h>
#include <sys/mman.h>
#endif
#include <assert.h>
@@ -147,9 +149,6 @@ static void sleep_ms(int ms) { Sleep(ms); }
#define _DEFAULT_SOURCE
#endif
#include <sys/mman.h>
#include <unistd.h>
static u32 plat_get_pagesize(void) { return (u32)sysconf(_SC_PAGESIZE); }
static void *plat_mem_reserve(u64 size) {