mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
[zone] Fix bad suggested mem calculation
Because the calculation didn't take the hunk header size (which is not included in the hunk size) into account, the conversion to MB was one short and thus the rounding up to the next 8 MB boundary was giving the current total hunk size (ie, the already given size). Most confusing to a user ("But I already asked for 128MB!").
This commit is contained in:
parent
ef64161835
commit
520371a3aa
1 changed files with 1 additions and 1 deletions
|
@ -722,7 +722,7 @@ Hunk_RawAlloc (memhunk_t *hunk, size_t size)
|
|||
Hunk_HighMark (hunk); // force free of temp hunk
|
||||
}
|
||||
if (hunk->size - hunk->low_used - hunk->high_used < size) {
|
||||
int mem = hunk->size / (1024 * 1024);
|
||||
int mem = (hunk->size + sizeof (memhunk_t)) / (1024 * 1024);
|
||||
mem += 8;
|
||||
mem &= ~7;
|
||||
Hunk_Print (hunk, 1);
|
||||
|
|
Loading…
Reference in a new issue