Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

mikronova/openzl-sys-rs

csrc/zlsys_budget.h

/* openzl-sys-rs: a per-thread allocation budget for OpenZL's allocation layer.
 * See src/budget.rs. Not part of OpenZL. */
#ifndef ZLSYS_BUDGET_H
#define ZLSYS_BUDGET_H
#include <stddef.h>

typedef struct {
    int active;       /* 0: no budget, every allocation passes */
    int exceeded;     /* set when an allocation was refused */
    size_t remaining; /* bytes left to charge */
} zlsys_budget;

void zlsys_budget_get(zlsys_budget* out);
void zlsys_budget_set(const zlsys_budget* in);

void* zlsys_malloc(size_t size);
void* zlsys_calloc(size_t n, size_t size);
void* zlsys_realloc(void* ptr, size_t size);
#endif