diff --git a/small__buffer__allocator_8cpp_source.html b/small__buffer__allocator_8cpp_source.html
index 386689c..2a4fe39 100644
--- a/small__buffer__allocator_8cpp_source.html
+++ b/small__buffer__allocator_8cpp_source.html
@@ -113,167 +113,106 @@
-
- 16static std::atomic<int> g_smallBufferSchwarzCounter;
-
- 18#define SMALL_BUFFER_GLOBALS_DECL(N) \
- 19 static AlignedBuffer<SmallBufferGlobals> g_globalsBuffer##N; \
- 20 static SmallBufferGlobals& g_globals##N = \
- 21 reinterpret_cast<SmallBufferGlobals&>(g_globalsBuffer##N)
+
+ 16template <
size_t kChunkSize>
+ 17SmallBufferGlobals& getSmallBufferGlobals() {
+
+ 19 static SmallBufferGlobals* globals =
new SmallBufferGlobals();
+
+
- 23SMALL_BUFFER_GLOBALS_DECL(4);
- 24SMALL_BUFFER_GLOBALS_DECL(8);
- 25SMALL_BUFFER_GLOBALS_DECL(16);
- 26SMALL_BUFFER_GLOBALS_DECL(32);
- 27SMALL_BUFFER_GLOBALS_DECL(64);
- 28SMALL_BUFFER_GLOBALS_DECL(128);
- 29SMALL_BUFFER_GLOBALS_DECL(256);
-
- 31#define SMALL_BUFFER_GLOBAL_FUNC_DEFS(N) \
-
- 33 SmallBufferGlobals& getSmallBufferGlobals<N>() { \
- 34 return g_globals##N; \
-
-
- 37SMALL_BUFFER_GLOBAL_FUNC_DEFS(4)
- 38SMALL_BUFFER_GLOBAL_FUNC_DEFS(8)
- 39SMALL_BUFFER_GLOBAL_FUNC_DEFS(16)
- 40SMALL_BUFFER_GLOBAL_FUNC_DEFS(32)
- 41SMALL_BUFFER_GLOBAL_FUNC_DEFS(64)
- 42SMALL_BUFFER_GLOBAL_FUNC_DEFS(128)
- 43SMALL_BUFFER_GLOBAL_FUNC_DEFS(256)
+ 23char* allocSmallBufferImpl(
size_t ordinal) {
+
+
+ 26 return detail::SmallBufferAllocator<4>::alloc();
+
+ 28 return detail::SmallBufferAllocator<8>::alloc();
+
+ 30 return detail::SmallBufferAllocator<16>::alloc();
+
+ 32 return detail::SmallBufferAllocator<32>::alloc();
+
+ 34 return detail::SmallBufferAllocator<64>::alloc();
+
+ 36 return detail::SmallBufferAllocator<128>::alloc();
+
+ 38 return detail::SmallBufferAllocator<256>::alloc();
+
+ 40 assert(
false &&
"Invalid small buffer ordinal requested");
+
+
+
- 45SchwarzSmallBufferInit::SchwarzSmallBufferInit() {
- 46 if (g_smallBufferSchwarzCounter.fetch_add(1, std::memory_order_acq_rel) == 0) {
- 47 ::new (&g_globals4) SmallBufferGlobals();
- 48 ::new (&g_globals8) SmallBufferGlobals();
- 49 ::new (&g_globals16) SmallBufferGlobals();
- 50 ::new (&g_globals32) SmallBufferGlobals();
- 51 ::new (&g_globals64) SmallBufferGlobals();
- 52 ::new (&g_globals128) SmallBufferGlobals();
- 53 ::new (&g_globals256) SmallBufferGlobals();
-
-
-
- 57static void destroySmallBufferGlobals() {
- 58 DISPENSO_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN();
- 59 g_globals4.~SmallBufferGlobals();
- 60 g_globals8.~SmallBufferGlobals();
- 61 g_globals16.~SmallBufferGlobals();
- 62 g_globals32.~SmallBufferGlobals();
- 63 g_globals64.~SmallBufferGlobals();
- 64 g_globals128.~SmallBufferGlobals();
- 65 g_globals256.~SmallBufferGlobals();
- 66 DISPENSO_TSAN_ANNOTATE_IGNORE_WRITES_END();
-
-
- 69SchwarzSmallBufferInit::~SchwarzSmallBufferInit() {
- 70 if (g_smallBufferSchwarzCounter.fetch_sub(1, std::memory_order_acq_rel) == 1) {
- 71 destroySmallBufferGlobals();
-
-
-
- 75char* allocSmallBufferImpl(
size_t ordinal) {
-
-
- 78 return detail::SmallBufferAllocator<4>::alloc();
-
- 80 return detail::SmallBufferAllocator<8>::alloc();
-
- 82 return detail::SmallBufferAllocator<16>::alloc();
-
- 84 return detail::SmallBufferAllocator<32>::alloc();
-
- 86 return detail::SmallBufferAllocator<64>::alloc();
-
- 88 return detail::SmallBufferAllocator<128>::alloc();
-
- 90 return detail::SmallBufferAllocator<256>::alloc();
-
- 92 assert(
false &&
"Invalid small buffer ordinal requested");
-
-
-
-
- 97void deallocSmallBufferImpl(
size_t ordinal,
void* buf) {
-
-
- 100 detail::SmallBufferAllocator<4>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 103 detail::SmallBufferAllocator<8>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 106 detail::SmallBufferAllocator<16>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 109 detail::SmallBufferAllocator<32>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 112 detail::SmallBufferAllocator<64>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 115 detail::SmallBufferAllocator<128>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 118 detail::SmallBufferAllocator<256>::dealloc(
reinterpret_cast<char*
>(buf));
-
-
- 121 assert(
false &&
"Invalid small buffer ordinal requested");
-
-
-
- 125size_t approxBytesAllocatedSmallBufferImpl(
size_t ordinal) {
-
-
- 128 return detail::SmallBufferAllocator<4>::bytesAllocated();
-
- 130 return detail::SmallBufferAllocator<8>::bytesAllocated();
-
- 132 return detail::SmallBufferAllocator<16>::bytesAllocated();
-
- 134 return detail::SmallBufferAllocator<32>::bytesAllocated();
-
- 136 return detail::SmallBufferAllocator<64>::bytesAllocated();
-
- 138 return detail::SmallBufferAllocator<128>::bytesAllocated();
-
- 140 return detail::SmallBufferAllocator<256>::bytesAllocated();
-
- 142 assert(
false &&
"Invalid small buffer ordinal requested");
-
-
-
-
- 147template <
size_t kChunkSize>
- 148SmallBufferAllocator<kChunkSize>::PerThreadQueuingData::~PerThreadQueuingData() {
-
-
-
- 152 if (g_smallBufferSchwarzCounter.fetch_add(1, std::memory_order_acq_rel) > 0) {
- 153 enqueue_bulk(buffers_, count_);
-
-
- 156 if (g_smallBufferSchwarzCounter.fetch_sub(1, std::memory_order_acq_rel) == 1) {
- 157 destroySmallBufferGlobals();
-
-
- 160 DISPENSO_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN();
- 161 ptoken().~ProducerToken();
- 162 ctoken().~ConsumerToken();
- 163 DISPENSO_TSAN_ANNOTATE_IGNORE_WRITES_END();
-
-
- 166template class SmallBufferAllocator<4>;
- 167template class SmallBufferAllocator<8>;
- 168template class SmallBufferAllocator<16>;
- 169template class SmallBufferAllocator<32>;
- 170template class SmallBufferAllocator<64>;
- 171template class SmallBufferAllocator<128>;
- 172template class SmallBufferAllocator<256>;
-
-
-
+ 45void deallocSmallBufferImpl(
size_t ordinal,
void* buf) {
+
+
+ 48 detail::SmallBufferAllocator<4>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 51 detail::SmallBufferAllocator<8>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 54 detail::SmallBufferAllocator<16>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 57 detail::SmallBufferAllocator<32>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 60 detail::SmallBufferAllocator<64>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 63 detail::SmallBufferAllocator<128>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 66 detail::SmallBufferAllocator<256>::dealloc(
reinterpret_cast<char*
>(buf));
+
+
+ 69 assert(
false &&
"Invalid small buffer ordinal requested");
+
+
+
+ 73size_t approxBytesAllocatedSmallBufferImpl(
size_t ordinal) {
+
+
+ 76 return detail::SmallBufferAllocator<4>::bytesAllocated();
+
+ 78 return detail::SmallBufferAllocator<8>::bytesAllocated();
+
+ 80 return detail::SmallBufferAllocator<16>::bytesAllocated();
+
+ 82 return detail::SmallBufferAllocator<32>::bytesAllocated();
+
+ 84 return detail::SmallBufferAllocator<64>::bytesAllocated();
+
+ 86 return detail::SmallBufferAllocator<128>::bytesAllocated();
+
+ 88 return detail::SmallBufferAllocator<256>::bytesAllocated();
+
+ 90 assert(
false &&
"Invalid small buffer ordinal requested");
+
+
+
+
+ 95template <
size_t kChunkSize>
+ 96SmallBufferAllocator<kChunkSize>::PerThreadQueuingData::~PerThreadQueuingData() {
+ 97 enqueue_bulk(buffers_, count_);
+
+ 99 DISPENSO_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN();
+ 100 ptoken().~ProducerToken();
+ 101 ctoken().~ConsumerToken();
+ 102 DISPENSO_TSAN_ANNOTATE_IGNORE_WRITES_END();
+
+
+ 105template class SmallBufferAllocator<4>;
+ 106template class SmallBufferAllocator<8>;
+ 107template class SmallBufferAllocator<16>;
+ 108template class SmallBufferAllocator<32>;
+ 109template class SmallBufferAllocator<64>;
+ 110template class SmallBufferAllocator<128>;
+ 111template class SmallBufferAllocator<256>;
+
+
+
diff --git a/small__buffer__allocator_8h.html b/small__buffer__allocator_8h.html
index 2898cc1..55ef8c0 100644
--- a/small__buffer__allocator_8h.html
+++ b/small__buffer__allocator_8h.html
@@ -163,7 +163,7 @@