Skip to content

Commit

Permalink
keytablelist bugfix (#2835)
Browse files Browse the repository at this point in the history
  • Loading branch information
MJY-HUST authored Dec 6, 2024
1 parent f187d2c commit 264ba31
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/bthread/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@

namespace bthread {

DEFINE_uint32(key_table_list_size, 5000,
DEFINE_uint32(key_table_list_size, 4000,
"The maximum length of the KeyTableList. Once this value is "
"exceeded, a portion of the KeyTables will be moved to the "
"global free_keytables list.");

DEFINE_uint32(borrow_from_globle_size, 100,
DEFINE_uint32(borrow_from_globle_size, 200,
"The maximum number of KeyTables retrieved in a single operation "
"from the global free_keytables when no KeyTable exists in the "
"current thread's keytable_list.");
Expand Down Expand Up @@ -289,11 +289,12 @@ class BAIDU_CACHELINE_ALIGNMENT KeyTableList {
count++;
}
if (prev != NULL) {
prev->next = NULL;
if (*target == NULL) {
*target = _head;
prev->next = NULL;
} else {
(*target)->next = _head;
prev->next = *target;
*target = _head;
}
_head = current;
_length -= count;
Expand Down

0 comments on commit 264ba31

Please sign in to comment.