Commit bc328488 authored by Daniel Kochmański's avatar Daniel Kochmański

Get rid of bunch of eval-when forms

Also adding extra eval-when around generic get-cons makes the package
compile under XCL.
parent 87de16b9
...@@ -387,24 +387,32 @@ Estimated total monitoring overhead: 0.88 seconds ...@@ -387,24 +387,32 @@ Estimated total monitoring overhead: 0.88 seconds
;;; The get-cons macro is called to find the total number of bytes ;;; The get-cons macro is called to find the total number of bytes
;;; consed since the beginning of time. ;;; consed since the beginning of time.
(eval-when (compile load eval) #+cmu
#+cmu (defmacro get-cons ()
(defmacro get-cons () "The get-cons macro is called to find the total number of bytes
"The get-cons macro is called to find the total number of bytes
consed since the beginning of time." consed since the beginning of time."
'(the consing-type (ext:get-bytes-consed))) '(the consing-type (ext:get-bytes-consed)))
#+clisp #+clisp
(defmacro get-cons () (defmacro get-cons ()
`(the consing-type `(the consing-type
(multiple-value-bind (real1 real2 run1 run2 gc1 gc2 space1 space2 gccount) (multiple-value-bind (real1 real2 run1 run2 gc1 gc2 space1 space2 gccount)
(sys::%%time) (sys::%%time)
(declare (ignore real1 real2 run1 run2 gc1 gc2 gccount)) (declare (ignore real1 real2 run1 run2 gc1 gc2 gccount))
(dpb space1 (byte 24 24) space2)))) (dpb space1 (byte 24 24) space2))))
#+clozure
(defmacro get-cons ()
`(the consing-type (ccl::total-bytes-allocated)))
#+clozure #+ecl
;; ECL has to compile the inlined C-code, otherwise it gets the generic
;; definition.
(eval-when (eval)
(warn "No consing will be reported unless the package is compiled.")
(defmacro get-cons () (defmacro get-cons ()
`(the consing-type (ccl::total-bytes-allocated)))) (defmacro get-cons ()
'(the consing-type 0))))
#+ecl #+ecl
;; ECL has to compile the inlined C-code, otherwise it gets the generic ;; ECL has to compile the inlined C-code, otherwise it gets the generic
...@@ -415,12 +423,13 @@ Estimated total monitoring overhead: 0.88 seconds ...@@ -415,12 +423,13 @@ Estimated total monitoring overhead: 0.88 seconds
"ecl_make_unsigned_integer(GC_get_total_bytes())" "ecl_make_unsigned_integer(GC_get_total_bytes())"
:one-liner t)))) :one-liner t))))
(eval-when (compile load eval) #-(or cmu clisp clozure ecl)
(unless (fboundp 'get-cons) (progn
(eval-when (compile eval) (eval-when (compile eval)
(warn "No consing will be reported unless a get-cons function is ~ (warn "No consing will be reported unless a get-cons function is ~
defined.")) defined."))
(eval-when (load eval)
(defmacro get-cons () '(the consing-type 0)))) (defmacro get-cons () '(the consing-type 0))))
;;; ******************************** ;;; ********************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment