[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: lua_newthread etc.
- From: "Albert-Jan Brouwer" <acj.brouwer@...>
- Date: Thu, 23 Jan 2003 11:09:08 +0100
> > lua_newthread() does not seem to be checking its
> > state allocation (luaE_newthread->mallocstate
> > in state.c) for possible failure.
> It doesn't need to. luaM_malloc never returns NULL
> when called with a non-null lua state (it throws
> an error, instead).
This may be fine when creating a co-routine from
a Lua context. But I am calling lua_newthread from
a C context. Does that mean I should call lua_newthread
through lua_pcall if I am to prevent my application
from exiting on an error? If so, what other Lua API
functions should be treated with similar caution?