comparison src/ChangeLog @ 4844:91b3d00e717f

Various cleanups for Dynarr code, from Unicode-internal ws dynarr.c: Add comment explaining Dynarr_largest() use. dynarr.c: In Dynarr_insert_many(), don't call Dynarr_resize() unless we actually need to resize, and note that an assert() that we are inserting at or below the current end could be wrong if code wants to access stuff between `len' and `largest'. dynarr.c: Don't just Dynarr_resize() to the right size; instead use Dynarr_reset() then Dynarr_add_many(), so that the 'len' and 'largest' and such get set properly. dynarr.c, faces.c, gutter.c, lisp.h, lread.c, lrecord.h, redisplay-output.c, redisplay.c: Rename Dynarr member 'cur' to 'len' since it's the length of the dynarr, not really a pointer to a "current insertion point". Use type_checking_assert() instead of just assert() in some places. Add additional assertions (Dynarr_verify*()) to check that we're being given positions within range. Use them in Dynarr_at, Dynarr_atp, etc. New Dynarr_atp_allow_end() for retrieving a pointer to a position that might be the element past the last one. New Dynarr_past_lastp() to retrieve a pointer to the position past the last one, using Dynarr_atp_allow_end(). Change code appropriately to use it. Rename Dynarr_end() to Dynarr_lastp() (pointer to the last element) for clarity, and change code appropriately to use it. Change code appropriately to use Dynarr_begin(). Rewrite Dynarr_add_many(). New version can accept a NULL pointer to mean "reserve space but don't put anything in it". Used by stack_like_malloc().
author Ben Wing <ben@xemacs.org>
date Wed, 13 Jan 2010 04:07:42 -0600
parents 715b15990d0a
children a98ca4640147
comparison
equal deleted inserted replaced
4843:715b15990d0a 4844:91b3d00e717f
1 2010-01-13 Ben Wing <ben@xemacs.org>
2
3 * dynarr.c:
4 Add comment explaining Dynarr_largest() use.
5
6 * dynarr.c (Dynarr_insert_many):
7 In Dynarr_insert_many(), don't call Dynarr_resize() unless we
8 actually need to resize, and note that an assert() that we are
9 inserting at or below the current end could be wrong if code
10 wants to access stuff between `len' and `largest'.
11
12 * dynarr.c (stack_like_malloc):
13 Don't just Dynarr_resize() to the right size; instead use
14 Dynarr_reset() then Dynarr_add_many(), so that the 'len' and
15 'largest' and such get set properly.
16
17 * dynarr.c (Dynarr_insert_many):
18 * dynarr.c (Dynarr_delete_many):
19 * dynarr.c (Dynarr_memory_usage):
20 * dynarr.c (stack_like_free):
21 * faces.c (add_face_cachel):
22 * gutter.c (output_gutter):
23 * lisp.h:
24 * lisp.h (Dynarr_declare):
25 * lisp.h (Dynarr_length):
26 * lisp.h (Dynarr_add):
27 * lisp.h (Dynarr_increment):
28 * lisp.h (Dynarr_pop):
29 * lread.c (define_structure_type):
30 * lread.c (define_structure_type_keyword):
31 * lrecord.h:
32 * lrecord.h (XD_DYNARR_DESC):
33 * lrecord.h (XD_LISP_DYNARR_DESC):
34 * redisplay-output.c (compare_display_blocks):
35 * redisplay-output.c (output_display_line):
36 * redisplay.c (add_ichar_rune_1):
37 * redisplay.c (create_text_block):
38 * redisplay.c (generate_formatted_string_db):
39 * redisplay.c (create_string_text_block):
40 * redisplay.c (point_visible):
41 * redisplay.c (mark_glyph_block_dynarr):
42 * redisplay.c (mark_redisplay_structs):
43 * redisplay.c (line_start_cache_end):
44 * redisplay.c (update_line_start_cache):
45 * redisplay.c (glyph_to_pixel_translation):
46 * redisplay.c (pixel_to_glyph_translation):
47 Rename Dynarr member 'cur' to 'len' since it's the length of
48 the dynarr, not really a pointer to a "current insertion point".
49
50 Use type_checking_assert() instead of just assert() in some places.
51
52
53 Add additional assertions (Dynarr_verify*()) to check that we're
54 being given positions within range. Use them in Dynarr_at,
55 Dynarr_atp, etc. New Dynarr_atp_allow_end() for retrieving a
56 pointer to a position that might be the element past the last one.
57 New Dynarr_past_lastp() to retrieve a pointer to the position
58 past the last one, using Dynarr_atp_allow_end(). Change code
59 appropriately to use it.
60
61 Rename Dynarr_end() to Dynarr_lastp() (pointer to the last
62 element) for clarity, and change code appropriately to use it.
63
64 Change code appropriately to use Dynarr_begin().
65
66 Rewrite Dynarr_add_many(). New version can accept a NULL pointer
67 to mean "reserve space but don't put anything in it". Used by
68 stack_like_malloc().
69
70
1 2010-01-13 Ben Wing <ben@xemacs.org> 71 2010-01-13 Ben Wing <ben@xemacs.org>
2 72
3 * lisp.h: 73 * lisp.h:
4 * lisp.h (inline_type_checking_assert): 74 * lisp.h (inline_type_checking_assert):
5 Add structure_checking_assert(), gc_checking_assert(), etc. for 75 Add structure_checking_assert(), gc_checking_assert(), etc. for