コード例 #1
0
ファイル: Allocator_admin.c プロジェクト: madafoo/cjdns
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);
}
コード例 #2
0
ファイル: Core.c プロジェクト: AdUser/cjdns
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);
}