From ed040c9704c69272b79a1a8ae3368f3e1fd36e35 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sun, 9 Jun 2024 21:38:45 +0200 Subject: Comments cleanup --- bxgen.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/bxgen.c b/bxgen.c index d672b2f..f0f569b 100755 --- a/bxgen.c +++ b/bxgen.c @@ -200,6 +200,9 @@ typedef struct { // Pool, a collection of all entities. // +// NOTE +// We use one single large memory block for *everything*. +// typedef struct { i64 entity_count; @@ -255,7 +258,7 @@ void u_elf_x86_64(i64 unit, c8 const *output_file_name); // ================================================================ // -// Implementation +// Main features implementation // // ================================================================ @@ -514,8 +517,11 @@ void unit_write(entity_pool_t *pool, i64 unit, u16 target, FILE *out) { fwrite(code, 1, code_size, out); } -// Helpers implementation +// ================================================================ +// +// Helpers implementation // +// ================================================================ #ifndef DISABLE_HELPERS @@ -523,6 +529,11 @@ void unit_write(entity_pool_t *pool, i64 unit, u16 target, FILE *out) { // static entity_pool_t g_pool = { + // Statically allocate a large memory block. + // + // TODO + // Reallocate the memory block when necessary. + // .entities_capacity = MAX_ENTITY_COUNT, .entities = (entity_t[MAX_ENTITY_COUNT]) { 0 }, }; @@ -572,8 +583,11 @@ void u_elf_x86_64(i64 unit, c8 const *output_file_name) { #endif -// Example +// ================================================================ // +// Example +// +// ================================================================ #ifndef DISABLE_EXAMPLE -- cgit v1.2.3