diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-15 10:48:36 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-15 11:19:51 -0700 |
commit | f1b06fd5fc66377f85b420d3d40c666da9dca2a5 (patch) | |
tree | 588b05ababc36aaec1d28f6543aa35b180cba79c /src/ccl.c | |
parent | d0145537fa511a44e2a4af01da3947e92f0b8331 (diff) | |
download | emacs-f1b06fd5fc66377f85b420d3d40c666da9dca2a5.tar.gz |
Prefer Fvector to make_uninit_vector
Fvector is less error-prone than make_uninit_vector, as it
avoids the possibility of a GC crash due to an uninitialized
vector. So prefer Fvector to make_uninit_vector when this is
easy (and when there's no significant performance difference).
Inspired by a suggestion by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2020-08/msg00313.html
* src/ccl.c (Fregister_ccl_program):
* src/ccl.c (Fregister_ccl_program):
* src/charset.c (Fdefine_charset_internal):
* src/font.c (Fquery_font, Ffont_info, syms_of_font):
* src/fontset.c (font_def_new, Fset_fontset_font):
* src/ftfont.c (ftfont_shape_by_flt):
* src/hbfont.c (hbfont_shape):
* src/macfont.m (macfont_shape):
* src/search.c (Fnewline_cache_check):
* src/xfaces.c (Fx_family_fonts):
* src/xfns.c (Fx_window_property_attributes):
Prefer Fvector to make_uninit_vector when either is easy.
* src/fontset.c (font_def_new): Now a function with one less
arg instead of a do-while macro, and renamed from FONT_DEF_NEW.
All uses changed.
Diffstat (limited to 'src/ccl.c')
-rw-r--r-- | src/ccl.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/ccl.c b/src/ccl.c index ef059ffff25..e85cfa6cdf2 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -2219,15 +2219,8 @@ Return index number of the registered CCL program. */) /* Extend the table. */ Vccl_program_table = larger_vector (Vccl_program_table, 1, -1); - { - Lisp_Object elt = make_uninit_vector (4); - - ASET (elt, 0, name); - ASET (elt, 1, ccl_prog); - ASET (elt, 2, resolved); - ASET (elt, 3, Qt); - ASET (Vccl_program_table, idx, elt); - } + ASET (Vccl_program_table, idx, + CALLN (Fvector, name, ccl_prog, resolved, Qt)); Fput (name, Qccl_program_idx, make_fixnum (idx)); return make_fixnum (idx); |