From 907fc5cc431aa2cf56538f6012af31690593b372 Mon Sep 17 00:00:00 2001 From: Yang Hu Date: Fri, 14 Jun 2024 23:51:44 -0400 Subject: [PATCH 1/2] Config.uk: change dependency; glue.c: adapt to new threading interface Signed-off-by: Yang Hu --- Config.uk | 3 +-- glue.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Config.uk b/Config.uk index 6dd18fd..006061e 100644 --- a/Config.uk +++ b/Config.uk @@ -8,9 +8,8 @@ menuconfig LIBMIMALLOC bool "mimalloc: a compact general purpose allocator with excellent performance" default n select LIBUKSCHED - select LIBNEWLIBC + select LIBMUSL select LIBPOSIX_SYSINFO - select LIBPTHREAD_EMBEDDED select LIBUKALLOCREGION if LIBMIMALLOC config MIMALLOC_DEBUG diff --git a/glue.c b/glue.c index 4973cd4..1d21ed9 100644 --- a/glue.c +++ b/glue.c @@ -62,7 +62,7 @@ * 4. Transition EBT allocator -> Mimalloc: * We transition as soon as the TLS has been allocated and the %fs register * set. This is checked at every EBT allocation by inspecting - * uk_thread_current()->prv which typically points to the thread local + * uk_thread_current()->priv which typically points to the thread local * storage. Since memory allocations might happen during Mimalloc's * initialization itself (e.g. calls to malloc() by pthread) the early boot * time allocator continues to satisfy requests until Mimalloc is ready @@ -88,7 +88,7 @@ static inline int _tls_ready(void) /* Is the thread local storage ready? */ struct uk_thread *current = uk_thread_current(); - return current && current->prv != NULL; + return current && current->priv != NULL; } /* boot-time malloc interface */ From 90cfb4c1d2f92d34465ac3388b89532b08434d3f Mon Sep 17 00:00:00 2001 From: Yang Hu Date: Sun, 16 Jun 2024 16:31:34 -0400 Subject: [PATCH 2/2] mimaloc*.h: include stddef.h to silence compiler errors Signed-off-by: Yang Hu --- include/uk/mimalloc.h | 1 + include/uk/mimalloc_impl.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uk/mimalloc.h b/include/uk/mimalloc.h index eadeae1..b2aa506 100644 --- a/include/uk/mimalloc.h +++ b/include/uk/mimalloc.h @@ -35,6 +35,7 @@ #define __LIBMIMALLOC_H__ #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/uk/mimalloc_impl.h b/include/uk/mimalloc_impl.h index 6b237cd..a077c1e 100644 --- a/include/uk/mimalloc_impl.h +++ b/include/uk/mimalloc_impl.h @@ -41,6 +41,7 @@ #define __LIBMIMALLOC_IMPL_H__ #include +#include #ifdef __cplusplus extern "C" {