mirror of
https://github.com/xtreme8000/CavEX.git
synced 2025-01-22 09:11:55 -05:00
Displaylist: decrease memory waste
factor 1.25 instead of 2
This commit is contained in:
parent
aec06849af
commit
76998a7234
1 changed files with 2 additions and 1 deletions
|
@ -80,7 +80,8 @@ void displaylist_pos(struct displaylist* l, int16_t x, int16_t y, int16_t z) {
|
|||
}
|
||||
|
||||
if(l->index + 9 > l->length) {
|
||||
l->length *= 2;
|
||||
l->length = (l->length * 5 / 4 + 9 + DISPLAYLIST_CLL - 1)
|
||||
/ DISPLAYLIST_CLL * DISPLAYLIST_CLL;
|
||||
l->data = realloc(l->data, l->length + DISPLAYLIST_CLL);
|
||||
assert(l->data);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue