[Openmcl-devel] bytes of memory allocated

Tom Emerson tremerson at gmail.com
Sun Sep 23 18:16:27 UTC 2012


On Sun, Sep 23, 2012 at 12:54 PM, Taoufik Dachraoui
<dachraoui.taoufik at gmail.com> wrote:
> ;;; I am using taup function as an arbitrary example
> ? (time (taup '(+ 2) nil))
> (TAUP '(+ 2) NIL)
> took 0 milliseconds (0.000 seconds) to run.
> During that period, and with 2 available CPU cores,
>      0 milliseconds (0.000 seconds) were spent in user mode
>      0 milliseconds (0.000 seconds) were spent in system mode
>  128 bytes of memory allocated.
> (+ 2)
>
> As shown by the time function 128 bytes of memory is allocated while
> evaluating (taup '(+ 1 2) nil)

I suspect the memory was allocated for the '(+ 2), though without
knowing the implementation I don't know if that would be 128 bytes:

? (disassemble #'(lambda () (taup '(+ 2) nil)))
;;; #'(lambda () (taup '(+ 2) nil))
L0
     [0] (leaq (@ (:^ L0) (% rip)) (% fn))
     [7] (testl (% nargs) (% nargs))
     [9] (jne L49)
    [11] (pushq (% rbp))
    [12] (movq (% rsp) (% rbp))

;;; '(+ 2)
    [15] (movq (@ '(+ 2) (% fn)) (% arg_y))

;;; (taup '(+ 2) nil)
    [22] (movl ($ #x1300B) (% arg_z.l))
    [27] (movl ($ 16) (% nargs))
    [32] (movq (@ 'TAUP (% fn)) (% temp0))
    [39] (leaveq)
    [40] (jmpq (@ 10 (% temp0)))

;;; #<no source text>
L49
    [49] (uuo-error-wrong-number-of-args)




-- 
Tom Emerson
tremerson at gmail.com
http://www.dreamersrealm.net/tree



More information about the Openmcl-devel mailing list