stbrumme/smallz4

How to use without global variables?

reFX-Mike opened this issue · 1 comments

Hi Stephan,

I'm a bit confused about the "GET_BYTE" and "SEND_BYTES" callbacks. They don't contain a "void* userData" pointer (or something similar) and thus I don't see how we could pass any file-handles, or source pointers etc. to them.

Even your own command-line tool simply uses global variables to solve this problem and thus is completely unusable in a multi-threaded context.

We intended to use it within a vst-plugin (a windows DLL that gets loaded by a host) and using global variables would mean that all instances would share the same variables and trample upon each other's memory.

Thanks,
Mike

Version 1.4 introduced such a user pointer, see commit 31089b0