[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C coding practice for top of stack
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 22 Feb 2013 09:31:35 +0200
2013/2/21 Marc Lepage <email@example.com>:
> My question is whether it might be better, in cases like this, to set the
> top of the stack before adding more stuff. So we have just value, then
Two related queries.
1. If you fail to checkstack and the function's error handling is
classified as '-', this may cause low-level errors (segmentation
etc) not caught by Lua, right?
2. I've written a vararg function which builds up a lot of stuff
on top of the vararg, but the vararg itself is not returned.
There seems not to be a cheap API function for removing
contiguous buried items, you have to do it one at a time.
That's O(n^2) if the number 'n' of items to remove is the
same the depth to which they are buried. Is it in any way
perilous just to leave them there?