Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Fix Hunk_Alloc() failures in FACENORMALS parsing#511

Merged
apanteleev merged 3 commits intoNVIDIA:masterfrom
res2k:fix-facenormals-alloc
Dec 10, 2025
Merged

Fix Hunk_Alloc() failures in FACENORMALS parsing#511
apanteleev merged 3 commits intoNVIDIA:masterfrom
res2k:fix-facenormals-alloc

Conversation

@res2k
Copy link
Contributor

@res2k res2k commented Dec 6, 2025

The issues:

  • When encountering a FACENORMALS extended BSP lump, a tightly bounded amount of extra memory is requested.
    However, at runtime, more than that is requested, as (a) allocations may possibly be larger than assumed due to the "round to cacheline" done in Hunk_TryAlloc(), and (b) multiple allocations happening (each being "round"ed as well).
  • Additionally, the extra memory counting didn't take the "round to cacheline" into account.

The fixes:

  • Applying the same alignment as in Hunk_TryAlloc() to the extra memory requested for an extended lump
  • Request a bit more than the "tight" amount for FACENORMALS

WatIsDeze added a commit to PolyhedronStudio/Q2RTXPerimental that referenced this pull request Dec 8, 2025
@apanteleev apanteleev merged commit 1559972 into NVIDIA:master Dec 10, 2025
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants