void hlua_applet_http_fct(struct appctx *ctx);
struct task *hlua_process_task(struct task *task, void *context, unsigned int state);
-extern THREAD_LOCAL unsigned int hlua_not_dumpable;
#else /* USE_LUA */
/************************ For use when Lua is disabled ********************/
}
if (hlua && hlua->T) {
- if (hlua_not_dumpable == 0) {
- luaL_traceback(hlua->T, hlua->T, NULL, 0);
- if (!append_prefixed_str(buf, lua_tostring(hlua->T, -1), pfx, '\n', 1))
- b_putchr(buf, '\n');
- }
- else
- chunk_appendf(buf, "Inside non-rentrant part, Stack traceback not available\n");
+ chunk_appendf(buf, "stack traceback:\n ");
+ append_prefixed_str(buf, hlua_traceback(hlua->T, "\n "), pfx, '\n', 0);
+ b_putchr(buf, '\n');
}
else
b_putchr(buf, '\n');
static struct hlua_mem_allocator hlua_global_allocator THREAD_ALIGNED(64);
- /* > 0 if lua is in a non-rentrant part, thus with a non-dumpable stack */
-THREAD_LOCAL unsigned int hlua_not_dumpable = 0;
-
/* These functions converts types between HAProxy internal args or
* sample and LUA types. Another function permits to check if the
* LUA stack contains arguments according with an required ARG_T
/* a limit of ~0 means unlimited and boot complete, so there's no need
* for accounting anymore.
*/
- if (likely(~zone->limit == 0)) {
- hlua_not_dumpable++;
- ptr = realloc(ptr, nsize);
- hlua_not_dumpable--;
- return ptr;
- }
+ if (likely(~zone->limit == 0))
+ return realloc(ptr, nsize);
if (!ptr)
osize = 0;
return NULL;
} while (!_HA_ATOMIC_CAS(&zone->allocated, &old, new));
- hlua_not_dumpable++;
ptr = realloc(ptr, nsize);
- hlua_not_dumpable--;
if (unlikely(!ptr && nsize)) // failed
_HA_ATOMIC_SUB(&zone->allocated, nsize - osize);