Commit c62af02
committed
Implement bump pointer allocator for allocTmp()
Replace individual calloc() calls with efficient block-based allocation:
- Allocate from larger blocks (4KB initial, grows to 64KB max)
- O(1) pointer bump for allocations within block
- 8-byte alignment for structure safety
- Blocks freed per-frame in flushAllocTmp()
Benefits:
- Fewer malloc calls: 1-2 blocks vs 20-30 individual allocations/frame
- Better cache locality with contiguous allocations
- Simpler cleanup: free 1-2 blocks instead of looping 20-30 times1 parent 1d4fc88 commit c62af02
1 file changed
+48
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
122 | 131 | | |
123 | 132 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
127 | 160 | | |
128 | 161 | | |
129 | 162 | | |
130 | | - | |
131 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
132 | 166 | | |
| 167 | + | |
| 168 | + | |
133 | 169 | | |
134 | | - | |
135 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
0 commit comments