Re: More on garbage collection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: More on garbage collection

Luiz Henrique de Figueiredo
>BeginFrame(FB_PNG, "ball.png", 320, 240)
>
>Sphere {
>	radius = 1.0,
>	colour = Blue,
>	centre = Point { y = -3.0 }
>}
>
>EndFrame()

How about this instead:

Frame{whatever=FB_PNG, file="ball.png", width=320, height=240;
 Sphere {
	 radius = 1.0,
	 colour = Blue,
	 centre = Point { y = -3.0 }
 }
 -- plus whatever other objects.
}

Now, whatever Sphere or Union returns is not garbaged collected until Frame ends.

Or perhaps I'm missing something.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: More on garbage collection

Alex Sandro Queiroz e Silva
On Sat, 3 Feb 2001, Luiz Henrique de Figueiredo wrote:

> Or perhaps I'm missing something.

Hallo,
	No, it's a nice solution. I haven't thought about using the
"mixed" syntax for tables. The only drawback is that it may look a bit
strange for non-Lua programmers, but this is not really a problem.
	Thanks,

  --Alex	[hidden email]		Lab. de Computação Gráfica/UFC
+----------------------------------------------------------------------------+
|"Minha força vem da solidão. Não tenho medo das chuvas tempestuosas nem das |
| grandes ventanias soltas, pois eu também sou o escuro da noite."	     |
|	- Clarice Lispector						     |
+----------------------------------------------------------------------------+