diff options
| author | Dmitry Antipov | 2012-11-08 18:10:28 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-11-08 18:10:28 +0400 |
| commit | 914adc427f7d1159356e465ec616c65a2ea902af (patch) | |
| tree | a4af121088abea87624dd93640d1deb1dd54ea95 /src/buffer.c | |
| parent | d14bb752ea51331ce2fb459c6ffacd8b11f80bb0 (diff) | |
| download | emacs-914adc427f7d1159356e465ec616c65a2ea902af.tar.gz emacs-914adc427f7d1159356e465ec616c65a2ea902af.zip | |
Shrink struct vectorlike_header to the only size field.
* lisp.h (enum pvec_type): Avoid explicit enum member values.
Adjust comment.
(enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
PVEC_TYPE_MASK to arrange new bitfield in the vector header.
(PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
(PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
information from the vector header. Adjust comment.
(XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
(PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
layout.
(XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
(struct vectorlike_header): Remove next member. Adjust comment.
(struct Lisp_Subr): Add convenient header. Adjust comment.
(allocate_pseudovector): Adjust prototype.
* alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
(sweep_string, lisp_malloc): Remove useless prototypes.
(enum mem_type): Adjust comment.
(NEXT_IN_FREE_LIST): New macro.
(SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
(Fmake_bool_vector): Likewise.
(struct large_vector): New type to represent allocation unit for
the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
(large_vectors): Change type to struct large_vector.
(allocate_vector_from_block): Simplify.
(PSEUDOVECTOR_NBYTES): Replace with...
(vector_nbytes): ...new function. Adjust users.
(sweep_vectors): Adjust processing of large vectors.
(allocate_vectorlike): Likewise.
(allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
Add easserts. Adjust XSETPVECTYPESIZE usage.
(allocate_buffer): Use BUFFER_PVEC_INIT.
(live_vector_p): Adjust to match large vector.
* buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
* buffer.h (struct buffer): Add next member.
(BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
New macros.
(FOR_EACH_BUFFER): Adjust to match struct buffer change.
* fns.c (internal_equal): Adjust to match enum pvec_type change.
(copy_hash_table): Adjust to match vector header change.
* lread.c (defsubr): Use XSETPVECTYPE.
* .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
(xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
(xvecsize): New command.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index bb69675346a..1d58df54f6f 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5105,11 +5105,6 @@ void | |||
| 5105 | init_buffer_once (void) | 5105 | init_buffer_once (void) |
| 5106 | { | 5106 | { |
| 5107 | int idx; | 5107 | int idx; |
| 5108 | /* If you add, remove, or reorder Lisp_Objects in a struct buffer, make | ||
| 5109 | sure that this is still correct. Otherwise, mark_vectorlike may not | ||
| 5110 | trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ | ||
| 5111 | const int pvecsize | ||
| 5112 | = (offsetof (struct buffer, own_text) - header_size) / word_size; | ||
| 5113 | 5108 | ||
| 5114 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); | 5109 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); |
| 5115 | 5110 | ||
| @@ -5132,8 +5127,8 @@ init_buffer_once (void) | |||
| 5132 | /* This is not strictly necessary, but let's make them initialized. */ | 5127 | /* This is not strictly necessary, but let's make them initialized. */ |
| 5133 | bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*")); | 5128 | bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*")); |
| 5134 | bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*")); | 5129 | bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*")); |
| 5135 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); | 5130 | BUFFER_PVEC_INIT (&buffer_defaults); |
| 5136 | XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); | 5131 | BUFFER_PVEC_INIT (&buffer_local_symbols); |
| 5137 | 5132 | ||
| 5138 | /* Set up the default values of various buffer slots. */ | 5133 | /* Set up the default values of various buffer slots. */ |
| 5139 | /* Must do these before making the first buffer! */ | 5134 | /* Must do these before making the first buffer! */ |