lua-users home
lua-l archive

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



On 20-Aug-04, at 4:43 PM, Edgar Toernig wrote:

Whether an object is constructed on the heap or the stack is not
a conceptual difference, it is an implementation detail.

Oh, it is a difference.  There is no "..." object.  There's
only a syntax to access the varargs.  You see the difference
in the benchmark above :-)

This same effect could be achieved with the single-bit reference
count which has been mooted several times. In this particular
case, no reference to the vararg object is ever present outside
of the stack, and a simple memory management optimisation could
avoid the gc effect.

Since arbitrary gc optimisations are possible, I continue to believe
that the heap vs. stack issue is an implementation detail.

Having said that, in the real world implementation details are
important.

R.