Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com_hunkmegs replacement #71

Open
ouned opened this issue Jun 4, 2016 · 1 comment
Open

com_hunkmegs replacement #71

ouned opened this issue Jun 4, 2016 · 1 comment

Comments

@ouned
Copy link
Member

ouned commented Jun 4, 2016

dynamically requesting memory makes more sense in 2016.
https://github.com/JACoders/OpenJK/blob/master/codemp/qcommon/z_memman_pc.cpp

@ouned ouned added this to the Version 1.3 milestone Jun 4, 2016
@aufau
Copy link
Member

aufau commented Jun 4, 2016

They replaced hunk memory with zone memory tagged by TAG_HUNK. I'd like to have a list of all reasons for id tech 3 using hunk memory before dropping it.

  • Bad performance/buggy malloc on DOS (obsolete)
  • Performance – hunk memory is often used for large number of small, dynamic-like allocations.
  • Leak safety – hunk permanent memory is normally dropped only when unloading a map so there is no Hunk_Free and leaking possibility. (zone memory can do as well with Z_FreeTags)
  • HUNK_DEBUG (hunklog, hunksmallog). I actually used it for debugging.
  • Deterministic memory layout – This allows us to consistently reproduce memory bugs.
  • …more?

To me these reasons are enough to keep it. Perhaps we could automatically adjust com_hunkmegs to improve on the original issue.

@ouned ouned removed this from the Version 1.3 milestone Feb 6, 2017
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

No branches or pull requests

2 participants