Ejemplo n.º 1
0
static void adminMemory(Dict* input, void* vcontext, String* txid)
{
    struct MemoryContext* context = vcontext;
    Dict d = Dict_CONST(
        String_CONST("bytes"), Int_OBJ(MallocAllocator_bytesAllocated(context->allocator)), NULL
    );
    Admin_sendMessage(&d, txid, context->admin);
}
Ejemplo n.º 2
0
static void adminMemory(Dict* input, void* vcontext, String* txid)
{
    struct Context* context = (struct Context*) vcontext;
    uint8_t buffer[256];
    struct Allocator* alloc = BufferAllocator_new(buffer, 256);

    String* bytes = BSTR("bytes");
    Dict* d = Dict_new(alloc);
    Dict_putInt(d, bytes, MallocAllocator_bytesAllocated(context->allocator), alloc);

    Admin_sendMessage(d, txid, context->admin);
}