]> git.eshelyaron.com Git - emacs.git/commit
Block-based vector allocation of small vectors.
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 8 Jun 2012 08:44:30 +0000 (12:44 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Fri, 8 Jun 2012 08:44:30 +0000 (12:44 +0400)
commitf3372c8789c843a00912e7fc9793ded4beb9a35a
tree72217e83c99d83ce8b56884b0a21276669e1699b
parentd52ba5afda376fedc679ac6d4e003867d70866dd
Block-based vector allocation of small vectors.
* src/lisp.h (struct vectorlike_header): New field `nbytes',
adjust comment accordingly.
* src/alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
to denote vector blocks. Adjust users (live_vector_p,
mark_maybe_pointer, valid_lisp_object_p) accordingly.
(COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
(VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
(VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
(VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
(VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
(roundup_size): New constant.
(struct vector_block): New data type.
(vector_blocks, vector_free_lists, zero_vector): New variables.
(all_vectors): Renamed to `large_vectors'.
(allocate_vector_from_block, init_vectors, allocate_vector_from_block)
(sweep_vectors): New functions.
(allocate_vectorlike): Return `zero_vector' as the only vector of
0 items. Allocate new vector from block if vector size is less than
or equal to VBLOCK_BYTES_MAX.
(Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
(init_alloc_once): Add call to init_vectors.
* doc/lispref/internals.text (Garbage Collection): Document new
vector management code and vectorlike_header structure.
doc/lispref/ChangeLog
doc/lispref/internals.texi
src/ChangeLog
src/alloc.c
src/lisp.h