summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-06-09 21:38:45 +0200
committerMitya Selivanov <automainint@guattari.tech>2024-06-09 21:38:45 +0200
commited040c9704c69272b79a1a8ae3368f3e1fd36e35 (patch)
tree21cf6ac56aa639704ce5571ce6656c749e7ebad2
parentcc1cd3f8f48dc506086715bb207dfbf175c11575 (diff)
downloadbxgen-ed040c9704c69272b79a1a8ae3368f3e1fd36e35.zip
Comments cleanup
-rwxr-xr-xbxgen.c20
1 files 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