help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Identifying sources of allocations in a toy Mandelbrot package


From: Eli Zaretskii
Subject: Re: Identifying sources of allocations in a toy Mandelbrot package
Date: Sat, 20 Jan 2024 09:29:14 +0200

> From: Psionic K <psionik@positron.solutions>
> Date: Sat, 20 Jan 2024 12:14:53 +0900
> Cc: Psionic K <psionik@positron.solutions>, help-gnu-emacs@gnu.org, 
> incal@dataswamp.org, 
>       Eli Zaretskii <eliz@gnu.org>
> 
> > Any temporary Lisp objects will allocate memory. Their references will be 
> > on the stack, but the
> objects themselves will be on the heap.
> 
> I had presumed at a minimum that the compiler can re-use heap locations when 
> it decides there's no
> risk.  While the values will be in the heap, is there a way to destructively 
> re-use heap locations so that
> we are not burning through all of the heap during iteration?  Do function 
> calls re-use any heap space?
>  Does anything besides GC?   As it is, I can guess that every call to even + 
> or * is creating a unique
> float that now exists on the heap until GC'd.

Yes, every temporary Lisp object other than an integere smaller than
most-positive-fixnum gets allocated from the heap.  I don't know
enough about the native compiler and the optimizations it performs to
tell whether the native code changes that in any way, but I would be
surprised if it did.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]