Remove useless half of vector_free_lists array (bug#65491)
authorMattias Engdegård <mattiase@acm.org>
Mon, 25 Sep 2023 14:49:29 +0000 (16:49 +0200)
committerMattias Engdegård <mattiase@acm.org>
Mon, 25 Sep 2023 14:49:29 +0000 (16:49 +0200)
commitaa28527500210e542349cca3cd805a61a01c9dac
tree06340d15b079b07016568a6b22cc0204b588b662
parent98a1e480c60c47536e01079d28030f1b1b8c10e6
Remove useless half of vector_free_lists array (bug#65491)

The latter half of vector_free_lists was never used in any meaningful
way but it did require traversal during allocation and GC.  Reduce it
to sizes we actually allocate, with a bucket for bigger ones.

* src/alloc.c (VECTOR_MAX_FREE_LIST_INDEX): Rename to...
(VECTOR_FREE_LIST_ARRAY_SIZE): ... this and adjust its value.
(vector_free_lists): Use new, smaller size.
(setup_on_free_list, allocate_vector_from_block):
Adapt to new vector_free_lists size.
(pseudovector_nbytes): New function extracted from...
(vectorlike_nbytes): ...here.
src/alloc.c