File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -666,11 +666,14 @@ namespace daking {
666666
667667 DAKING_ALWAYS_INLINE node_t * _allocate () {
668668 node_t *& thread_local_node_list = _get_thread_local_node_list ();
669- if (!thread_local_node_list) DAKING_UNLIKELY {
669+ size_type& thread_local_node_size = _get_thread_local_node_size ();
670+ if (thread_local_node_size == 0 ) DAKING_UNLIKELY {
670671 while (!global_chunk_stack_.try_pop (thread_local_node_list)) {
671672 _reserve_global_internal ();
672673 }
674+ thread_local_node_size = thread_local_capacity;
673675 }
676+ thread_local_node_size--;
674677 DAKING_TSAN_ANNOTATE_ACQUIRE (thread_local_node_list);
675678 DAKING_TSAN_ANNOTATE_ACQUIRE (thread_local_node_list->next_ );
676679 node_t * res = std::exchange (thread_local_node_list, thread_local_node_list->next_ .load (std::memory_order_relaxed));
You can’t perform that action at this time.
0 commit comments