Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cmucl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cmucl
cmucl
Commits
7b4e019d
Commit
7b4e019d
authored
Sep 22, 2018
by
Raymond Toy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #69: Always compile in GC assertion code
parent
d7f49e51
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
487 additions
and
214 deletions
+487
-214
src/code/exports.lisp
src/code/exports.lisp
+4
-0
src/code/gc.lisp
src/code/gc.lisp
+58
-3
src/lisp/gencgc.c
src/lisp/gencgc.c
+425
-211
No files found.
src/code/exports.lisp
View file @
7b4e019d
...
...
@@ -1566,6 +1566,10 @@
"*TRUST-DYNAMIC-EXTENT-DECLARATIONS*"
"INVALID-FASL"
)
;; gencgc features
#+
gencgc
(
:export
"GET-GC-ASSERTIONS"
"SET-GC-ASSERTIONS"
)
;; run-program
(
:export
"RUN-PROGRAM"
"PROCESS-ALIVE-P"
"PROCESS-CLOSE"
...
...
src/code/gc.lisp
View file @
7b4e019d
...
...
@@ -22,7 +22,9 @@
*bytes-consed-between-gcs*
*gc-verbose*
*gc-inhibit-hook*
*gc-notify-before*
*gc-notify-after*
get-bytes-consed
*gc-run-time*
bytes-consed-between-gcs
get-bytes-consed-dfixnum
))
get-bytes-consed-dfixnum
get-gc-assertions
set-gc-assertions
))
(
in-package
"LISP"
)
(
export
'
(
room
))
...
...
@@ -72,10 +74,63 @@
(
progn
(
alien:def-alien-routine
get_bytes_allocated_lower
c-call:int
)
(
alien:def-alien-routine
get_bytes_allocated_upper
c-call:int
)
(
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
()
"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
: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
))
"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-generations
)
(
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
View file @
7b4e019d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment