]> git.eshelyaron.com Git - emacs.git/commit
Prefer Fvector to make_uninit_vector
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Aug 2020 17:48:36 +0000 (10:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Aug 2020 18:19:51 +0000 (11:19 -0700)
commitf1b06fd5fc66377f85b420d3d40c666da9dca2a5
tree588b05ababc36aaec1d28f6543aa35b180cba79c
parentd0145537fa511a44e2a4af01da3947e92f0b8331
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.
src/ccl.c
src/charset.c
src/font.c
src/fontset.c
src/ftfont.c
src/hbfont.c
src/macfont.m
src/search.c
src/xfaces.c
src/xfns.c