0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd::spirit: Use per-unit thread-local internal generator_state ptr.

This commit is contained in:
Jason Volk 2020-08-29 20:02:32 -07:00
parent a6277ac2d0
commit 8505635716
2 changed files with 1 additions and 13 deletions

View file

@ -21,7 +21,7 @@ __attribute__((visibility("default")))
IRCD_EXCEPTION(error, generator_error);
IRCD_EXCEPTION(generator_error, buffer_overrun);
extern thread_local struct generator_state *generator_state;
static thread_local struct generator_state *generator_state {nullptr};
extern thread_local char generator_buffer[8][64_KiB];
}}
@ -260,10 +260,6 @@ inline bool
boost::spirit::karma::detail::enable_buffering<ircd::spirit::sink_type>::buffer_copy(std::size_t maxwidth)
{
assert(state.prev);
#if __has_builtin(__builtin_assume)
__builtin_assume(state.prev != nullptr);
#endif
auto &prev
{
*state.prev
@ -327,10 +323,6 @@ inline bool
boost::spirit::karma::detail::buffering_policy::output(const char &value)
{
assert(ircd::spirit::generator_state);
#if __has_builtin(__builtin_assume)
__builtin_assume(ircd::spirit::generator_state != nullptr);
#endif
auto &state
{
*ircd::spirit::generator_state

View file

@ -28,10 +28,6 @@ decltype(ircd::spirit::rule_buffer)
ircd::spirit::rule_buffer
alignas(64);
thread_local
decltype(ircd::spirit::generator_state)
ircd::spirit::generator_state;
thread_local
decltype(ircd::spirit::generator_buffer)
ircd::spirit::generator_buffer