add public function for getting the UiContext UCX mempool newapi tip

Sun, 17 Nov 2024 15:21:50 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 17 Nov 2024 15:21:50 +0100
branch
newapi
changeset 387
80edb1a93f7a
parent 386
a91e3f6db7cf

add public function for getting the UiContext UCX mempool

ui/common/context.c file | annotate | diff | comparison | revisions
ui/ui/toolkit.h file | annotate | diff | comparison | revisions
--- 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) {
--- 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);

mercurial