[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



I wrote to mkant@cs.cmu.edu regarding code from a.gp.cs.cmu.edu, directory
/usr/mkant/Public:
> I got the code just fine, and expect to have some of the MACL porting done in
> a few days.  If I'm successful, I'll of course send the modifications back.

mkant@cs.cmu.edu replies:
I believe defsystem works fine in MACL, even though I complain in the
documentation about MACL's use of colons in pathnames. Logical-pathnames
doesn't currently support MACL pathnames, but it should be trivial to write
the parser (just look at how Unix one's are done and replace / with :). xref
should work without mods. 

metering needs a consing measuring function. Here's some code I was working
on. The problem is that the consing measurement resets after a gc, instead
of being cumulative. One possible solution is to advise gc to update a 
global variable.
(in-package :ccl)

(eval-when (eval compile)
  #+:CCL(defconstant $pagesize 4096)
  #+:CCL(defconstant $lstFP #x-a42)
  #+:CCL(defconstant $currentA5 #x904)
  #+:CCL(defconstant $pagecounts #x-18e)
  #+:CCL(defconstant $consfirstob 64))

#+:CCL
(defun get-consing (&aux pages fp)
  ;; Returns the number of conses used. (8 bytes each)
  (let* ((a5 (%get-ptr $currentA5))
         (ptr (%inc-ptr a5 $pagecounts)))
    (%ilsr 3 (%i+ (%i- (%ilsl 12 (%i- (setq pages (%get-word ptr 0)) 1))
                       (%i* pages $consfirstob))
                  (if (eq 0 (setq fp (%get-long a5 $lstFP)))
                    $pagesize
                    (%ilogand2 #xfff fp))))))


--mark


Question: is there a way to get the number of conses used without having the
count reset on every gc?

Thanks,
Paul