Beispiel #1
0
static void bytesAllocated(Dict* in, void* vcontext, String* txid, struct Allocator* requestAlloc)
{
    struct Allocator_admin_pvt* ctx = Identity_check((struct Allocator_admin_pvt*)vcontext);
    Dict* d = Dict_new(requestAlloc);
    Dict_putIntC(d, "bytes", Allocator_bytesAllocated(ctx->alloc), requestAlloc);
    Admin_sendMessage(d, txid, ctx->admin);
}
Beispiel #2
0
static void adminMemory(Dict* input, void* vcontext, String* txid, struct Allocator* requestAlloc)
{
    struct Context* context = vcontext;
    Dict d = Dict_CONST(
        String_CONST("bytes"), Int_OBJ(Allocator_bytesAllocated(context->allocator)), NULL
    );
    Admin_sendMessage(&d, txid, context->admin);
}