|
On Sep 5, 2013, at 10:25 PM, Andres Perera <andres.p@zoho.com> wrote:
Um, what? First, you are assuming a simple case where there are no free() calls in pa. Second you are assuming that the heap manager has not over-allocated or pre-allocated pages (most do). Third you are assuming the heap manager makes no attempt at padding or leaving expansion space, or choosing different allocation strategies for differently sized blocks, or does anything beyond a simplistic linear allocation. Almost no real-world system exhibits the linear allocation model your example assumes, and so I would assert that it is false in EVERY system I have ever used; most will have allocated significantly more pages than your model assumes. And even if it were true, so what? We were discussing the overhead of adding a void* to either Lua_State or Lua globals, a trivial addition to either structure. Nothing in that discussion is even vaguely impacted by the relationship between the C runtime heap manager and the OS VM allocation mechanisms. --Tim |