[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] make tcc reentrant
From: |
Daniel Glöckner |
Subject: |
Re: [Tinycc-devel] make tcc reentrant |
Date: |
Sat, 7 Dec 2019 12:51:31 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi,
On Sat, Dec 07, 2019 at 11:34:11AM +0100, Ulrich Schmidt wrote:
> - The in scenario1 unloved 1 function parameter can be ignored and the
> values stored locally:
> #define LIBPARAM1
> #define VALUE(v) v
> ..
>
> somereturn somefunc(LIBPARAM1 ...) {
> VALUE(count) = 0;
> ...
>
> - in scenario 2 we define the 2 macros different:
> #define LIBPARAM1 TCCState *s1,
> #define VALUE(v) s1->v
We need a macro
#if scenario == 1
#define PASSPARAM1
#else
#define PASSPARAM1 s1,
#endif
Grouping all globals in the TCCState structure might be beneficial
even if we don't switch to those macros, because of the cache locality
Christian wrote about. The VALUE macro in scenario 1 would then be
#define VALUE(v) global_state.v
Btw, has anyone thought about handling TCCState like the context is
handled in the OpenGL API? It has one function to select the context
to use for following operations and the operations themselves don't
have a parameter for the context. If the pointer to the TCCState is
stored in a normal or in a TLS variable is up to us and might even
be a compile time option (that is set to "normal" for compilation
with tcc as long as tcc doesn't know how to generate TLS variables).
Best regards,
Daniel
- Re: [Tinycc-devel] make tcc reentrant, (continued)
- Re: [Tinycc-devel] make tcc reentrant, uso ewin, 2019/12/03
- Re: [Tinycc-devel] make tcc reentrant, Ulrich Schmidt, 2019/12/03
- Re: [Tinycc-devel] make tcc reentrant, Karl Yerkes, 2019/12/06
- Re: [Tinycc-devel] make tcc reentrant, Ulrich Schmidt, 2019/12/11
- Re: [Tinycc-devel] make tcc reentrant, Ulrich Schmidt, 2019/12/13
Re: [Tinycc-devel] make tcc reentrant, Michael Matz, 2019/12/06
- Re: [Tinycc-devel] make tcc reentrant, ag, 2019/12/06
- Re: [Tinycc-devel] make tcc reentrant, Charles Lohr, 2019/12/06
- Re: [Tinycc-devel] make tcc reentrant, Domingo Alvarez Duarte, 2019/12/07
- Re: [Tinycc-devel] make tcc reentrant, Ulrich Schmidt, 2019/12/07
- Re: [Tinycc-devel] make tcc reentrant,
Daniel Glöckner <=
- Re: [Tinycc-devel] make tcc reentrant, uso ewin, 2019/12/08
- Re: [Tinycc-devel] make tcc reentrant, Ulrich Schmidt, 2019/12/08
- Re: [Tinycc-devel] make tcc reentrant, Michael Matz, 2019/12/09
- Re: [Tinycc-devel] make tcc reentrant, Michael Matz, 2019/12/09
Re: [Tinycc-devel] make tcc reentrant, Michael Matz, 2019/12/09
Re: [Tinycc-devel] make tcc reentrant, Ulrich Schmidt, 2019/12/09
Re: [Tinycc-devel] make tcc reentrant, Michael Matz, 2019/12/09
Re: [Tinycc-devel] make tcc reentrant, grischka, 2019/12/06
Re: [Tinycc-devel] make tcc reentrant, Christian Jullien, 2019/12/07