Menu

📰
0

Reddit - Please wait for verification

C++·/u/yurtrimu·3 days ago
#uNU23BgA
Reading 0:00
15s threshold

A small C89-compatible fixed-size object pool for cases where you want predictable performance and avoid repeated malloc/free calls. It preallocates a block of objects and reuses them in constant time (O(1)) using a simple push/pop style API. The goal is to reduce heap fragmentation and allocation overhead in systems where objects are frequently created and destroyed. Key properties: C89 compatible Fixed-size preallocated pool O(1) allocate/deallocate No per-object heap churn after initialization Lightweight, dependency-free Use cases are things like game objects (particles, entities), network buffers, or embedded/real-time systems where allocation cost needs to be stable. submitted by /u/yurtrimu [link] [comments]

Read More