Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
925241a9 by Raymond Toy at 2018-09-22T19:57:52Z
Fix some typos in comment.
- - - - -
1 changed file:
- tests/issues.lisp
Changes:
=====================================
tests/issues.lisp
=====================================
@@ -397,11 +397,11 @@
(sleep 5)
(assert-eql :exited (ext:process-status p)))))
-;; For some reason this used to work linux CI but not doesn't. But
-;; this test passes on my Fedora and debian systems. See issue #64.
-;; So until we figure this out, disable this test when we're running a
-;; pipeline with linux, but otherwise enable it. The pipeline defines
-;; the envvar GITLAB_CI so check for that.
+;; For some reason this used to work with linux CI but now doesn't.
+;; But this test passes on my Fedora and debian systems. See issue
+;; #64. So until we figure this out, disable this test when we're
+;; running a pipeline with linux, but otherwise enable it. The
+;; pipeline defines the envvar GITLAB_CI so check for that.
;;
;; It would be better if lisp-unit had a way of marking tests as known
;; failures, but it doesn't.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/925241a9828267cef4a479676…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/925241a9828267cef4a479676…
You're receiving this email because of your account on gitlab.common-lisp.net.
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/ebc4d6ece03c716ae01bf05d…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/ebc4d6ece03c716ae01bf05d…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-69-compile-in-gc-assert at cmucl / cmucl
Commits:
ebc4d6ec by Raymond Toy at 2018-09-15T21:08:34Z
Add docstrings for the GC assertion functions
- - - - -
1 changed file:
- src/code/gc.lisp
Changes:
=====================================
src/code/gc.lisp
=====================================
@@ -83,6 +83,13 @@
(alien:def-alien-variable ("pre_verify_gen_0" gc-verify-new-objects) c-call:int)
(alien:def-alien-variable ("verify_gens" gc-verify-generations) c-call:int)
(defun get-gc-assertions ()
+ "Returns a list of the current GC assertion settings. The list is
+ in the same format as the keyword arguments to SET-GC-ASSERTIONS,
+ i.e.,
+
+ (apply #'set-gc-assertions (get-gc-assertions))
+
+ See SET-GC-ASSERTIONS for more information."
(list :assert-level gc-assert-level
:verify-after-free-heap (not (zerop gc-verify-after-free-heap))
:verify-generations gc-verify-generations
@@ -91,6 +98,23 @@
(verify-after-free-heap nil verify-after-free-heap-p)
(verify-generations 6 verify-generations-p)
(verify-new-objects nil verify-new-objects-p))
+ "Set GC assertion to the specified value:
+ :ASSERT-LEVEL-
+ Defaults to 0, higher values indicate more assertions are enabled.
+
+ :VERIFY-AFTER-FREE-HEAP
+ If non-NIL, the heap is verified for consistency whenever
+ part of the heap is collected.
+
+ :VERIFY-GENERATIONS
+ Set to generation number. When GC occurs, generations
+ equal to or higher than this value are checked for
+ consistency.
+
+ :VERIFY-NEW-OBJECTS
+ When GC occurs for the newest generation, the heap for this
+ generation is checked for validity.
+"
(declare (type (and fixnum unsigned-byte) assert-level)
(type boolean verify-after-free-heap)
(type (integer 0 6) verify-generation)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/ebc4d6ece03c716ae01bf05d7…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/ebc4d6ece03c716ae01bf05d7…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-69-compile-in-gc-assert at cmucl / cmucl
Commits:
62d02997 by Raymond Toy at 2018-09-04T05:05:32Z
Add function to get and set GC check options
Define GET-GC-ASSERTIONS to get the current GC assertions and
SET-GC-ASSERTIONS to set them. These control the whether gc_assert is
called; whether a a pre-scan of generation 0 is done before GC;
whether we verify the heap after gc_free_heap is called from purify;
and the verify pointers to old-space when GCing generations greater
than or equal the given generation.
Update C code to change boolean variables to int's to make it simple
to to access from Lisp. (Don't have c-call:boolean.)
- - - - -
2 changed files:
- src/code/gc.lisp
- src/lisp/gencgc.c
Changes:
=====================================
src/code/gc.lisp
=====================================
@@ -72,14 +72,39 @@
(progn
(alien:def-alien-routine get_bytes_allocated_lower c-call:int)
(alien:def-alien-routine get_bytes_allocated_upper c-call:int)
- ;; Controls GC assertions that are enabled in the runtime. A value
- ;; of 0 disables all assertions (the normal default).
- (alien:def-alien-variable gc_assert_level c-call:int)
- (setf (documentation 'gc-assert-level 'variable)
- "Current GC assertion level. Higher values enable more GC assertions")
(defun dynamic-usage ()
(dfixnum:dfixnum-pair-integer
- (get_bytes_allocated_upper) (get_bytes_allocated_lower))))
+ (get_bytes_allocated_upper) (get_bytes_allocated_lower)))
+
+ ;; Controls GC assertions that are enabled in the runtime. A value
+ ;; of 0 disables all assertions (the normal default).
+ (alien:def-alien-variable ("gc_assert_level" gc-assert-level) c-call:int)
+ (alien:def-alien-variable ("verify_after_free_heap" gc-verify-after-free-heap) c-call:int)
+ (alien:def-alien-variable ("pre_verify_gen_0" gc-verify-new-objects) c-call:int)
+ (alien:def-alien-variable ("verify_gens" gc-verify-generations) c-call:int)
+ (defun get-gc-assertions ()
+ (list :assert-level gc-assert-level
+ :verify-after-free-heap (not (zerop gc-verify-after-free-heap))
+ :verify-generations gc-verify-generations
+ :verify-new-objects (not (zerop gc-verify-new-objects))))
+ (defun set-gc-assertions (&key (assert-level 0 assert-level-p)
+ (verify-after-free-heap nil verify-after-free-heap-p)
+ (verify-generations 6 verify-generations-p)
+ (verify-new-objects nil verify-new-objects-p))
+ (declare (type (and fixnum unsigned-byte) assert-level)
+ (type boolean verify-after-free-heap)
+ (type (integer 0 6) verify-generation)
+ (type boolean verify-new-objects))
+ (when assert-level-p
+ (setf gc-assert-level assert-level))
+ (when verify-after-free-heap-p
+ (setf gc-verify-after-free-heap (if verify-after-free-heap 1 0)))
+ (when verify-generations-p
+ (setf gc-verify-generations verify-generations))
+ (when verify-new-objects-p
+ (setf gc-verify-new-objects (if verify-new-objects 1 0)))
+ (values))
+ )
#+cgc
(c-var-frob dynamic-usage "bytes_allocated")
=====================================
src/lisp/gencgc.c
=====================================
@@ -260,15 +260,15 @@ int verify_gens = NUM_GENERATIONS;
* makes GC very, very slow, so don't enable this unless you really
* need it!)
*/
-boolean pre_verify_gen_0 = FALSE;
+int pre_verify_gen_0 = FALSE;
/*
* Enable checking for bad pointers after gc_free_heap called from purify.
*/
#if 0 && defined(DARWIN)
-boolean verify_after_free_heap = TRUE;
+int verify_after_free_heap = TRUE;
#else
-boolean verify_after_free_heap = FALSE;
+int verify_after_free_heap = FALSE;
#endif
/*
@@ -8031,7 +8031,9 @@ collect_garbage(unsigned last_gen)
/* Verify the new objects created by lisp code. */
if (pre_verify_gen_0) {
- fprintf(stderr, "Pre-Checking generation 0\n");
+ if (gencgc_verbose > 0) {
+ fprintf(stderr, "Pre-Checking generation 0\n");
+ }
verify_generation(0);
}
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/62d029977c6e367cfbef2ec68…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/62d029977c6e367cfbef2ec68…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-69-compile-in-gc-assert at cmucl / cmucl
Commits:
d895efeb by Raymond Toy at 2018-09-02T22:39:02Z
Correct an assertion on rehash-threshold.
The limit for rehash-threshold is 0.1 to 1. not 0 to 1. Also fix a
compiler warning about bad casts. And use an appropriate structure
type for the single-float object instead of hacking as float array.
- - - - -
cfaac541 by Raymond Toy at 2018-09-02T22:39:56Z
Add gc-assert-level in lisp
This allows users to change the runtime GC assertion level. Zero
means no assertions and greater than 0 means assertions are enabled.
- - - - -
2 changed files:
- src/code/gc.lisp
- src/lisp/gencgc.c
Changes:
=====================================
src/code/gc.lisp
=====================================
@@ -72,7 +72,11 @@
(progn
(alien:def-alien-routine get_bytes_allocated_lower c-call:int)
(alien:def-alien-routine get_bytes_allocated_upper c-call:int)
-
+ ;; Controls GC assertions that are enabled in the runtime. A value
+ ;; of 0 disables all assertions (the normal default).
+ (alien:def-alien-variable gc_assert_level c-call:int)
+ (setf (documentation 'gc-assert-level 'variable)
+ "Current GC assertion level. Higher values enable more GC assertions")
(defun dynamic-usage ()
(dfixnum:dfixnum-pair-integer
(get_bytes_allocated_upper) (get_bytes_allocated_lower))))
=====================================
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]
+ * float in the range [0.1, 1]
*/
lispobj threshold_obj = (lispobj) hash_table->rehash_threshold;
- float* raw_slots = PTR(threshold_obj);
- float threshold = raw_slots[2];
- gc_assert(threshold > 0 && threshold <= 1);
+ struct single_float* float_slot = (struct single_float*) PTR(threshold_obj);
+ float threshold = float_slot->value;
+ gc_assert(threshold >= 0.1 && threshold <= 1);
}
scavenge((lispobj *) hash_table, HASH_TABLE_SIZE);
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/ab9c63efd703fd07305b0491…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/ab9c63efd703fd07305b0491…
You're receiving this email because of your account on gitlab.common-lisp.net.