lua-users home
lua-l archive

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


Thank you, sounds like it so I will have a look

On Fri, 30 Apr 2021, 11:29 Viacheslav Usov, <via.usov@gmail.com> wrote:
On Fri, Apr 30, 2021 at 12:03 PM Lee Shallis <gb2985@gmail.com> wrote:
>
> I've written a library which uses the same type of allocator
> (deliberate choice as I was planning to plug a wrapper into lua) and
> was wondering how to get a hold of these pointers, simply put I have a
> multi-thread application that passes some pointers into those but I
> want the wrapper library to be link-able outside of my app and to that
> end it needs to have it's initialization done with 0 knowledge of the
> app running lua but still be able to play nicely with it's own
> internal allocations, the only way to do this is to grab the allocator
> function and user data passed to lua_newstate(), does anyone know how
> to do this with just public functions of lua?

I should say that all I really understood is the subject 'Values
passed into lua_newstate()', in which case I have an interpretation
for 'how to get a hold of these pointers', the rest of your message is
cryptic to me.

The answer to my interpretation of your question is lua_getallocf(),
that is how you get a hold of the values passed into lua_newstate().

If that's not what you want, you will probably have to reformulate your problem.

Cheers,
V.