Files
r/src/core/memory.h
T
retoor dc150f2ea2 chore: remove entire agent, auth, browse, chat, db_utils, and http_curl source trees
This commit deletes the complete implementation of the agent loop, authentication module, web browsing utilities, chat prompt builder, database helper, and HTTP client. All corresponding header files and test harnesses are also removed. The diff shows the deletion of 6 source files and 6 header files totaling over 1000 lines of code, including the agent state machine, API key resolution logic, curl-based HTTP functions, SQLite database initialization and CRUD operations, and the JSON chat prompt construction.
2026-01-29 01:21:11 +00:00

32 lines
757 B
C

// retoor <retoor@molodetz.nl>
#ifndef R_MEMORY_H
#define R_MEMORY_H
#include <stddef.h>
typedef struct arena_t {
char *current_block;
size_t block_size;
size_t block_used;
size_t block_count;
struct arena_block *blocks;
} arena_t;
typedef struct arena_block {
char *data;
size_t size;
struct arena_block *next;
} arena_block_t;
arena_t *arena_create(size_t chunk_size);
void *arena_alloc(arena_t *arena, size_t size);
char *arena_strdup(arena_t *arena, const char *str);
void arena_reset(arena_t *arena);
void arena_destroy(arena_t *arena);
#define ARENA_ALLOC(arena, type) ((type *)arena_alloc(arena, sizeof(type)))
#define ARENA_ARRAY(arena, type, count) ((type *)arena_alloc(arena, sizeof(type) * (count)))
#endif