ui/common/context.c

changeset 38
8ccdde37275b
parent 37
56016468753d
child 39
4e66271541e8
equal deleted inserted replaced
37:56016468753d 38:8ccdde37275b
349 ctx->group_widgets = ucx_list_append_a( 349 ctx->group_widgets = ucx_list_append_a(
350 mp->allocator, 350 mp->allocator,
351 ctx->group_widgets, 351 ctx->group_widgets,
352 gw); 352 gw);
353 } 353 }
354
355 void* ui_malloc(UiContext *ctx, size_t size) {
356 return ctx ? ucx_mempool_malloc(ctx->mempool, size) : NULL;
357 }
358
359 void* ui_calloc(UiContext *ctx, size_t nelem, size_t elsize) {
360 return ctx ? ucx_mempool_calloc(ctx->mempool, nelem, elsize) : NULL;
361 }
362
363 void ui_free(UiContext *ctx, void *ptr) {
364 if(ctx) {
365 ucx_mempool_free(ctx->mempool, ptr);
366 }
367 }
368
369 void* ui_realloc(UiContext *ctx, void *ptr, size_t size) {
370 return ctx ? ucx_mempool_realloc(ctx->mempool, ptr, size) : NULL;
371 }

mercurial