]> code.delx.au - gnu-emacs/commit
Add a few safety checks when ENABLE_CHECKING
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Nov 2015 18:38:19 +0000 (10:38 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Nov 2015 18:44:04 +0000 (10:44 -0800)
commit8afaa1321f8088bfb877fe4b6676e8517adb0bb7
tree7e865f4b42fc44ba38abf7d0188db0aa05096fbd
parentd696d62fea48096680d6d511a71c4df56d00a51f
Add a few safety checks when ENABLE_CHECKING

This was motivated by the recent addition of module code,
which added some ENABLE_CHECKING-enabled checks that are
useful elsewhere too.
* src/alloc.c (compact_font_cache_entry):
* src/fns.c (sweep_weak_table):
* src/lread.c (oblookup):
Use gc_asize rather than doing it by hand.
* src/emacs-module.c (module_make_global_ref)
(module_free_global_ref, module_vec_size):
Omit assertions that lisp.h now checks.
* src/lisp.h (XFASTINT, ASIZE): In functional implementations,
check that the result is nonnegative.  Use eassume, as this
info can help a bit when optimizing production code.
(XSYMBOL) [!USE_LSB_TAG]: Assert that argument is a symbol,
to be consistent with the USE_LSB_TAG case.
(gc_asize): New function, when ASIZE is needed in the gc.
(gc_aset): Use it.
(HASH_TABLE_P): Move definition up, so that it can be used ...
(XHASH_TABLE): ... here, to assert that the arg is a hash table.
src/alloc.c
src/emacs-module.c
src/fns.c
src/lisp.h
src/lread.c