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

[no subject]



CC: (BUG LISPM) at MIT-MC
    Date: Wed ,14 Nov 79 13:01:00 EDT
    From: Nis at MIT-AI (H. Keith Nishihara)
    To: (BUG LISPM) at MIT-AI
    
    re: small flonum contagion
    
    could the trig functions and sqrt be fixed so that when given 
    small flonum arguments they return small flonum results like 
    log and exp currently do.   
Yes someone should fix them.  This requires looking at the argument
to decide what precision of internal constants to use.
    also is it true that so long as no special variables are set that 
    computations on small flonums (using say log and exp in a compiled function
    where the results come and go to an art-q array)
    does not generate garbage?  what about the regular flonum case? 
    I guess what im asking is are there any useful rules of thumb for minimizing 
    garbage generation.  - keith
You're somewhat confused.  The actual situation is that use of small
flonums never generates any garbage (unless functions like log and exp
have internal large flonum intermediate results, which they shouldn't but may.)
Reading and printing small flonums very possibly generates garbage,
although I won't swear to it.

Large flonums and bignums will become permanent (i.e. generate garbage)
if you store them in any permanent place, including special-variable
values, list structure, arrays, etc., or if you have process scheduling
while holding onto temporary results.  (E.g. you read from the
keyboard.)  The only time they don't generate garbage is when temporary
results are only stored in local variables, passed as arguments, and
returned as single function-values.

Some time in the future things will be changed so that garbage will never
be generated by any use of objects other than hanging onto them for a long
time then discarding them.  However this has not been done yet.