masaori335 commented on code in PR #10961:
URL: https://github.com/apache/trafficserver/pull/10961#discussion_r1445686891


##########
src/proxy/hdrs/HdrHeap.cc:
##########
@@ -241,39 +240,50 @@ HdrHeap::allocate_str(int nbytes)
   //   but I already no that this code path is
   //   safe for forcing a str coalesce so I'm doing
   //   it here for sanity's sake
-  if (m_lost_string_space > static_cast<int>(MAX_LOST_STR_SPACE)) {
-    goto FAILED;
-  }
+  int coalesce = m_lost_string_space > static_cast<int>(MAX_LOST_STR_SPACE) ? 
1 : 0;
 
-RETRY:
-  // First check to see if we have a read/write
-  //   string heap
-  if (!m_read_write_heap) {
-    int next_size     = (last_size * 2) - sizeof(HdrStrHeap);
-    next_size         = next_size > nbytes ? next_size : nbytes;
-    m_read_write_heap = new_HdrStrHeap(next_size);
-  }
-  // Try to allocate of our read/write string heap
-  new_space = m_read_write_heap->allocate(nbytes);
+  for (;;) {
+    if (coalesce) {
+      switch (coalesce) {
+      case 2:
+        Warning("HdrHeap=%p coalescing twice", this);
+        break;
+      case 3:

Review Comment:
   Have you ever seen `coalesce` become more than `3`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to