some fixes to c's fixed_arena gen

This commit is contained in:
Edward R. Gonzalez 2024-11-30 23:48:14 -05:00
parent fbdb870986
commit 31a3609b28
2 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@ GEN_NS_END
#include <cstdlib> // for system() #include <cstdlib> // for system()
#include "components/fixed_arena.hpp" #include "components/memory.fixed_arena.hpp"
#include "components/misc.hpp" #include "components/misc.hpp"
using namespace gen; using namespace gen;

View File

@ -1,7 +1,7 @@
// #pragma once #pragma once
// #include "../project/gen.hpp" #include "../project/gen.hpp"
// using namespace gen; using namespace gen;
CodeBody gen_fixed_arenas() CodeBody gen_fixed_arenas()
{ {
@ -18,13 +18,13 @@ CodeBody gen_fixed_arenas()
char const* template_interface = stringize( char const* template_interface = stringize(
inline inline
void fixed_arena_init_<Name>(FixedArena_<Name>* result) { void fixed_arena_init_<Name>(FixedArena_<Name>* result) {
zero_size(& result.memory[0], <Size>); zero_size(& result->memory[0], <Size>);
result.arena = arena_init_from_memory(& result.memory[0], <Size>); result.arena = arena_init_from_memory(& result->memory[0], <Size>);
} }
inline inline
ssize fixed_arena_size_remaining_<Name>(FixedArena_<Name>* fixed_arena, ssize alignment) { ssize fixed_arena_size_remaining_<Name>(FixedArena_<Name>* fixed_arena, ssize alignment) {
return size_remaining(fixed_arena.arena, alignment); return size_remaining(fixed_arena->arena, alignment);
} }
); );