Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
55718b85
Commit
55718b85
authored
33 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Added CODE-PACKAGE-BREAKDOWN and UNINTERNED-SYMBOL-COUNT.
parent
842f445c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/room.lisp
+42
-3
42 additions, 3 deletions
code/room.lisp
with
42 additions
and
3 deletions
code/room.lisp
+
42
−
3
View file @
55718b85
...
...
@@ -7,18 +7,19 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/room.lisp,v 1.
6
1991/04/14
16:49:5
4 ram Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/room.lisp,v 1.
7
1991/04/14
23:57:1
4 ram Exp $"
)
;;;
;;; **********************************************************************
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/room.lisp,v 1.
6
1991/04/14
16:49:5
4 ram Exp $
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/room.lisp,v 1.
7
1991/04/14
23:57:1
4 ram Exp $
;;;
;;; Heap grovelling memory usage stuff.
;;;
(
in-package
"VM"
)
(
use-package
"SYSTEM"
)
(
export
'
(
memory-usage
count-no-ops
descriptor-vs-non-descriptor-storage
structure-usage
find-holes
print-allocated-objects
))
structure-usage
find-holes
print-allocated-objects
code-package-breakdown
uninterned-symbol-count
))
(
in-package
"LISP"
)
(
import
'
(
dynamic-0-space-start
dynamic-1-space-start
read-only-space-start
...
...
@@ -602,3 +603,41 @@
(
subseq
str
0
(
min
(
length
str
)
60
)))))))))
space
)))
(
values
))
;;;; Misc:
(
defun
uninterned-symbol-count
(
space
)
(
declare
(
type
spaces
space
))
(
let
((
total
0
)
(
uninterned
0
))
(
map-allocated-objects
#'
(
lambda
(
obj
type
size
)
(
declare
(
ignore
type
size
))
(
when
(
symbolp
obj
)
(
incf
total
)
(
unless
(
symbol-package
obj
)
(
incf
uninterned
))))
space
)
(
values
uninterned
(
float
(
/
uninterned
total
)))))
(
defun
code-package-breakdown
(
space
)
(
let
((
info
(
make-hash-table
:test
#'
equal
)))
(
map-allocated-objects
#'
(
lambda
(
obj
type
size
)
(
when
(
eql
type
code-header-type
)
(
let*
((
dinfo
(
code-debug-info
obj
))
(
name
(
if
dinfo
(
c::compiled-debug-info-package
dinfo
)
"UNKNOWN"
))
(
found
(
or
(
gethash
name
info
)
(
setf
(
gethash
name
info
)
(
cons
0
0
)))))
(
incf
(
car
found
))
(
incf
(
cdr
found
)
size
))))
space
)
(
collect
((
res
))
(
maphash
#'
(
lambda
(
k
v
)
(
res
(
list
v
k
)))
info
)
(
loop
for
((
count
.
size
)
name
)
in
(
sort
(
res
)
#'
>
:key
#'
cdar
)
do
(
format
t
"~20@A: ~:D bytes, ~:D objects.~%"
name
size
count
))))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment