Raymond Toy pushed to branch issue-69-compile-in-gc-assert at cmucl / cmucl
Commits: 5a2484ec by Raymond Toy at 2018-09-16T23:29:06Z Fix typo in declaration for verify-generations
- - - - - 9f7e34ad by Raymond Toy at 2018-09-22T16:06:20Z Assert rehash threshold is in (0,1]
Not 100% sure, but I think 0.1 is too large in some cases. Possibly if GC happens after allocating a hash table but before it's initialized.
Maybe we should prevent GC from happening before we've initialized some of the slots of the hash table?
- - - - -
2 changed files:
- src/code/gc.lisp - src/lisp/gencgc.c
Changes:
===================================== src/code/gc.lisp ===================================== @@ -117,7 +117,7 @@ " (declare (type (and fixnum unsigned-byte) assert-level) (type boolean verify-after-free-heap) - (type (integer 0 6) verify-generation) + (type (integer 0 6) verify-generations) (type boolean verify-new-objects)) (when assert-level-p (setf gc-assert-level assert-level))
===================================== src/lisp/gencgc.c ===================================== @@ -4813,12 +4813,12 @@ scav_hash_vector(lispobj * where, lispobj object) if (gc_assert_level > 0) { /* * Check to see that hash-table-rehash-threshold is a single - * float in the range [0.1, 1] + * float in the range (0, 1] */ lispobj threshold_obj = (lispobj) hash_table->rehash_threshold; struct single_float* float_slot = (struct single_float*) PTR(threshold_obj); float threshold = float_slot->value; - gc_assert(threshold >= 0.1 && threshold <= 1); + gc_assert(threshold > 0 && threshold <= 1); }
scavenge((lispobj *) hash_table, HASH_TABLE_SIZE);
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/ebc4d6ece03c716ae01bf05d7...