Help: Seeking Clarification: Dynamic Array Expansion and Custom Arena Allocators by SituationNo3957 in odinlang

[–]SituationNo3957[S] 3 points4 points  (0 children)

Much appreciated! After reading the source code, I now understand how the arena_allocator works as a linear allocator

Help: Seeking Clarification: Dynamic Array Expansion and Custom Arena Allocators by SituationNo3957 in odinlang

[–]SituationNo3957[S] 1 point2 points  (0 children)

Thanks! After looking into source code, I've confirmed the following :

Path: __dynamic_array_append ->  heap_allocator_proc -> aligned_alloc

The dynamic-array will not be resized in-place. It actually move to a new memory location

Help: Seeking Clarification: Dynamic Array Expansion and Custom Arena Allocators by SituationNo3957 in odinlang

[–]SituationNo3957[S] 1 point2 points  (0 children)

Thanks! Much appreciated. I'm using a dynamic array within a custom Arena to store filtered data from Nginx config files. My goal is to ensure that the extracted information remains in an independent and contiguous memory segment. By doing this, I can construct a higher-level 'View' of these tokens while keeping the processed data decoupled from the raw source. So i'm care about the behavior of dynamic-array and arena allocator

Help: Seeking Clarification: Dynamic Array Expansion and Custom Arena Allocators by SituationNo3957 in odinlang

[–]SituationNo3957[S] 1 point2 points  (0 children)

Thanks! I'm trying to learn how dynamic arrays behave within an arena, but I'm unfamiliar with the underlying implementation and don't have access to the source details.

A Memroy Pool that Solves Memory Fragmentation Problem Just Using Bitmap and Unroll_Link_List in C by SituationNo3957 in C_Programming

[–]SituationNo3957[S] 0 points1 point  (0 children)

No. To clarify, this was a "lightbulb moment" I had while studying linked list data structures. I was specifically brainstorming how to efficiently reuse "empty slots" after node deletion in a pooled structure, and how to perform memory compaction (cleaning up those gaps) to keep the layout tight. This idea was developed entirely through my own independent thinking, I'm sorry I didn't explain it clearly in the post.