Skip to content

Fix allocating memory in zone under 64 bit#28

Merged
Daivuk merged 2 commits intoDaivuk:masterfrom
korbykob:master
Feb 7, 2026
Merged

Fix allocating memory in zone under 64 bit#28
Daivuk merged 2 commits intoDaivuk:masterfrom
korbykob:master

Conversation

@korbykob
Copy link
Contributor

@korbykob korbykob commented Feb 7, 2026

Fixes #27 by using the size of a pointer to align anything allocated by the zone.

@Mellurboo
Copy link

please actually push this its a right ballache

@Daivuk Daivuk merged commit aa9510a into Daivuk:master Feb 7, 2026
6 of 10 checks passed
@Daivuk
Copy link
Owner

Daivuk commented Feb 7, 2026

I've merged didn't try it, I trust this is good. But I'm a little confused as to why this is an issue in the first place. This is original DOOM code. Aligning it like that will make allocation need bigger. Doesn't DOOM allocate fixed amount at the start? Then we end up with less memory. Did you play the full game to make sure this works?

@Mellurboo
Copy link

Did you play the full game to make sure this works?

playing the full game isnt possible as it infact Segmentation Faults at init, it points to doom_strcpy. this was tested on 4 machines

@korbykob
Copy link
Contributor Author

korbykob commented Feb 7, 2026

Yeah, I've been using this awesome project to port doom quick and easily, however I've had issues with memory alignment, I assume this would also just make things faster as aligned memory is atomic to read and write to, this does work fine from what I've tested with my own OS and other OSes too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allocations are aligned to 32 bit boundaries regardless of architecture

3 participants