0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-19 19:33:45 +02:00

ircd: Properly scope various visibility/linkages.

This commit is contained in:
Jason Volk 2022-06-13 15:08:16 -07:00
parent 16cae91875
commit df3304005a
7 changed files with 20 additions and 18 deletions

View file

@ -21,17 +21,17 @@ extern "C" void (*__free_hook)(void *, const void *);
namespace ircd::allocator namespace ircd::allocator
{ {
void *(*their_malloc_hook)(size_t, const void *); static void *(*their_malloc_hook)(size_t, const void *);
[[gnu::weak]] void *malloc_hook(size_t, const void *); [[gnu::weak]] void *malloc_hook(size_t, const void *);
static void install_malloc_hook(); static void install_malloc_hook();
static void uninstall_malloc_hook(); static void uninstall_malloc_hook();
void *(*their_realloc_hook)(void *, size_t, const void *); static void *(*their_realloc_hook)(void *, size_t, const void *);
[[gnu::weak]] void *realloc_hook(void *, size_t, const void *); [[gnu::weak]] void *realloc_hook(void *, size_t, const void *);
static void install_realloc_hook(); static void install_realloc_hook();
static void uninstall_realloc_hook(); static void uninstall_realloc_hook();
void (*their_free_hook)(void *, const void *); static void (*their_free_hook)(void *, const void *);
[[gnu::weak]] void free_hook(void *, const void *); [[gnu::weak]] void free_hook(void *, const void *);
static void install_free_hook(); static void install_free_hook();
static void uninstall_free_hook(); static void uninstall_free_hook();

View file

@ -13,8 +13,7 @@ namespace ircd::b58
[[gnu::visibility("internal")]] [[gnu::visibility("internal")]]
extern const string_view dict; extern const string_view dict;
[[gnu::visibility("internal")]] static thread_local char conv_tmp_buf[64_KiB];
thread_local char conv_tmp_buf[64_KiB];
} }
decltype(ircd::b58::dict) decltype(ircd::b58::dict)

View file

@ -57,7 +57,7 @@ ircd_backtrace_allow_libc_fix()
namespace ircd namespace ircd
{ {
thread_local std::array<const void *, 512> backtrace_buffer; static thread_local std::array<const void *, 512> backtrace_buffer;
} }
ircd::backtrace::backtrace() ircd::backtrace::backtrace()

View file

@ -1633,7 +1633,7 @@ ircd::ctx::debug_stats(const pool &pool)
namespace ircd::ctx::prof namespace ircd::ctx::prof
{ {
thread_local ticker _total; // Totals kept for all contexts. static thread_local ticker _total; ///< Totals kept for all contexts.
static void check_stack(); static void check_stack();
static void check_slice(); static void check_slice();

View file

@ -10,15 +10,19 @@
#include <cxxabi.h> #include <cxxabi.h>
thread_local char namespace ircd
outbuf[8192]; {
static thread_local char
demangle_outbuf[8192],
demangle_symbuf[8192];
}
std::string std::string
ircd::demangle(const char *const &symbol) ircd::demangle(const char *const &symbol)
{ {
const string_view demangled const string_view demangled
{ {
demangle(outbuf, symbol) demangle(demangle_outbuf, symbol)
}; };
return std::string(demangled); return std::string(demangled);
@ -29,7 +33,7 @@ ircd::demangle(const string_view &symbol)
{ {
const string_view demangled const string_view demangled
{ {
demangle(outbuf, symbol) demangle(demangle_outbuf, symbol)
}; };
return std::string(demangled); return std::string(demangled);
@ -40,10 +44,9 @@ ircd::demangle(const mutable_buffer &out,
const string_view &symbol_) const string_view &symbol_)
{ {
assert(size(symbol_) < 4096); assert(size(symbol_) < 4096);
thread_local char symbuf[8192];
const string_view symbol const string_view symbol
{ {
symbuf, strlcpy(symbuf, symbol_) demangle_symbuf, strlcpy(demangle_symbuf, symbol_)
}; };
return demangle(out, symbol.data()); return demangle(out, symbol.data());

View file

@ -42,8 +42,8 @@ ircd::fs::PATH_MAX_LEN
// Convenience scratch buffers for path making. // Convenience scratch buffers for path making.
namespace ircd::fs namespace ircd::fs
{ {
thread_local char _name_scratch[2][NAME_MAX_LEN]; static thread_local char _name_scratch[2][NAME_MAX_LEN];
thread_local char _path_scratch[2][PATH_MAX_LEN]; static thread_local char _path_scratch[2][PATH_MAX_LEN];
} }
// External mutable_buffer to the scratch // External mutable_buffer to the scratch
@ -440,8 +440,8 @@ ircd::fs::pathconf(const string_view &path,
namespace ircd::fs namespace ircd::fs
{ {
static const size_t _PATH_CSTR_BUFS {4}; static const size_t _PATH_CSTR_BUFS {4};
thread_local char _path_cstr[_PATH_CSTR_BUFS][PATH_MAX_LEN]; static thread_local char _path_cstr[_PATH_CSTR_BUFS][PATH_MAX_LEN];
thread_local size_t _path_cstr_pos; static thread_local size_t _path_cstr_pos;
} }
const char * const char *

View file

@ -99,7 +99,7 @@ static_assert
namespace ircd::http2 namespace ircd::http2
{ {
thread_local char error_fmt_buf[512]; static thread_local char error_fmt_buf[512];
} }
ircd::http2::error::error() ircd::http2::error::error()