This is an automated email from the ASF dual-hosted git repository.

wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 264ba318 keytablelist bugfix (#2835)
264ba318 is described below

commit 264ba3180b859d85ce6bbfb7bb0e9aa9991bc6ce
Author: Jingyuan <52315061+mjy-h...@users.noreply.github.com>
AuthorDate: Fri Dec 6 09:43:42 2024 +0800

    keytablelist bugfix (#2835)
---
 src/bthread/key.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/bthread/key.cpp b/src/bthread/key.cpp
index 5720a675..1bf5ec89 100644
--- a/src/bthread/key.cpp
+++ b/src/bthread/key.cpp
@@ -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.");
@@ -289,11 +289,12 @@ public:
             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;


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to