# HG changeset patch # User Olaf Wintermann # Date 1731853310 -3600 # Node ID 80edb1a93f7af837c9194da49f2fe55f41df4520 # Parent a91e3f6db7cf394987f47312f2501010fa085afa add public function for getting the UiContext UCX mempool diff -r a91e3f6db7cf -r 80edb1a93f7a ui/common/context.c --- a/ui/common/context.c Sun Nov 17 10:37:06 2024 +0100 +++ b/ui/common/context.c Sun Nov 17 15:21:50 2024 +0100 @@ -557,7 +557,11 @@ } UIEXPORT void *ui_allocator(UiContext *ctx) { - return ctx ? (void*)ctx->allocator : NULL; + return (void*)ctx->allocator; +} + +void* ui_cx_mempool(UiContext *ctx) { + return ctx->mp; } void* ui_malloc(UiContext *ctx, size_t size) { diff -r a91e3f6db7cf -r 80edb1a93f7a ui/ui/toolkit.h --- a/ui/ui/toolkit.h Sun Nov 17 10:37:06 2024 +0100 +++ b/ui/ui/toolkit.h Sun Nov 17 15:21:50 2024 +0100 @@ -469,6 +469,8 @@ UIEXPORT int* ui_active_groups(UiContext *ctx, int *ngroups); UIEXPORT void* ui_allocator(UiContext *ctx); +UIEXPORT void* ui_cx_mempool(UiContext *ctx); + UIEXPORT void* ui_malloc(UiContext *ctx, size_t size); UIEXPORT void* ui_calloc(UiContext *ctx, size_t nelem, size_t elsize); UIEXPORT void ui_free(UiContext *ctx, void *ptr);