Skip to content

Commit 421c4f4

Browse files
author
LoneWandererProductions
committed
fix rm
1 parent 70c96cb commit 421c4f4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ To move this system out of the prototyping phase and into a hardened, production
5252

5353
### 3. Hardware Memory Alignment Blindness
5454
* **Current State:** The bump allocators currently increment layouts directly by byte size (`_nextFreeOffset += size`). If a user allocates an odd structural layout (e.g., a 7-byte struct), subsequent items are placed on unaligned memory addresses, causing the CPU to fetch multiple cache-lines for single read instructions, tanking cache line efficiency.
55-
* **Production Fix:** Force all lane offsets to snap cleanly to hardware alignment boundaries (e.g., 16-byte, 32-byte, or 64-byte boundaries for SIMD alignment) using bitwise masking masks:
56-
$$\text{alignedOffset} = (\text{offset} + (\text{alignment} - 1)) \ \& \ \sim(\text{alignment} - 1)$$
55+
* **Production Fix:** Force all lane offsets to snap cleanly to hardware alignment boundaries (e.g., 16-byte, 32-byte, or 64-byte boundaries for SIMD alignment) using power-of-two bitwise masking layout constraints:
56+
```csharp
57+
alignedOffset = (offset + (alignment - 1)) & ~(alignment - 1);
5758

5859
### 4. Zero Defensive Buffer-Overrun Safety Guardrails
5960
* **Current State:** Resolving a handle exposes a raw native `nint` address space. If code reads or writes outside the structural bounds of that specific entry allocation, it will silently overwrite adjacent allocations or metadata arrays without an error, resulting in impossible-to-trace heap corruption.

0 commit comments

Comments
 (0)