TS-1861 Build fails with reclaimable freelist enabled

Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/54e9a1ef
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/54e9a1ef
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/54e9a1ef

Branch: refs/heads/sphinx-docs
Commit: 54e9a1efae3e8a3bbd82ef7331cd90c31d309ef5
Parents: f7ed0f6
Author: Leif Hedstrom <[email protected]>
Authored: Mon Apr 29 09:05:14 2013 -0600
Committer: Leif Hedstrom <[email protected]>
Committed: Mon Apr 29 09:05:45 2013 -0600

----------------------------------------------------------------------
 CHANGES                 |    5 ++++-
 lib/ts/ink_queue_ext.cc |   21 ++++++---------------
 2 files changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54e9a1ef/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9959ec1..dbb5fd0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,11 @@
                                                          -*- coding: utf-8 -*-
   Changes with Apache Traffic Server 3.3.3
 
+
   *) [TS-1858] Fix redefinition of timersub on Solaris
-  
+
+  *) [TS-1861] Build fails with reclaimable freelist enabled.
+
   *) [TS-1860] cacheurl doesn't compile on platforms with pcre/pcre.h
    (e.g. solaris).
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54e9a1ef/lib/ts/ink_queue_ext.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue_ext.cc b/lib/ts/ink_queue_ext.cc
index a89bdd9..7ceaa1c 100644
--- a/lib/ts/ink_queue_ext.cc
+++ b/lib/ts/ink_queue_ext.cc
@@ -40,6 +40,7 @@
 #include "ink_error.h"
 #include "ink_assert.h"
 #include "ink_resource.h"
+#include "ink_stack_trace.h"
 #include "ink_queue_ext.h"
 
 #if TS_USE_RECLAIMABLE_FREELIST
@@ -74,34 +75,24 @@ static inline pthread_t thread_id(void)
 
   return tid?tid:(tid = pthread_self());
 }
-#define THREAD_ID thread_id()
 #define MAX_CHUNK_BYTE_SIZE (page_size << 8)
 
 /*
  * For debug
  */
-#if 1
 #define show_info(tag, f, pCache) \
   __show_info(stdout, __FILE__, __LINE__, tag, f, pCache)
-#else
-#define show_info(tag, f, pCache) \
-  __silent(__FILE__, __LINE__, tag, f, pCache)
-#endif
 #define error_info(tag, f, pCache) \
   __show_info(stderr, __FILE__, __LINE__, tag, f, pCache)
 
 static inline void
-__silent(const char *file, int line,
-         const char *tag, InkFreeList *f, InkThreadCache *pCache) {}
-
-static inline void
 __show_info(FILE *fp, const char *file, int line,
             const char *tag, InkFreeList *f, InkThreadCache *pCache)
 {
 
   fprintf(fp, "[%lx:%02u][%s:%05d][%s] %6.2fM t:%-8uf:%-4u m:%-4u avg:%-6.1f"
           " M:%-4u csbase:%-4u csize:%-4u tsize:%-6u cbsize:%u\n",
-         (long)THREAD_ID, f->thread_cache_idx, file, line, tag,
+         (long)thread_id(), f->thread_cache_idx, file, line, tag,
          ((double)total_mem_in_byte/1024/1024),
          pCache->nr_total,
          pCache->nr_free,
@@ -243,7 +234,7 @@ ink_chunk_create(InkFreeList *f, InkThreadCache *pCache)
   type_size = f->type_size;
   chunk_size = f->chunk_size;
 
-  pChunk->tid = THREAD_ID;
+  pChunk->tid = thread_id();
   pChunk->head = chunk_addr;
   pChunk->type_size = type_size;
   pChunk->chunk_size = chunk_size;
@@ -280,7 +271,7 @@ ink_chunk_delete(InkFreeList *f, InkThreadCache *pCache, 
InkChunkInfo *pChunk)
   pCache->nr_free_chunks--;
 
   if (unlikely(munmap(chunk_addr, f->chunk_byte_size))) {
-    ink_stack_trace_dump()();
+    ink_stack_trace_dump();
     ink_fatal(1, "Failed to munmap %u bytes, %s", f->chunk_byte_size, 
strerror(errno));
   }
 
@@ -423,7 +414,7 @@ refresh_average_info(InkThreadCache *pCache)
 }
 
 static inline bool
-need_to_reclaim(InkFreeList *f, InkThreadCache *pCache, pthread_t tid)
+need_to_reclaim(InkFreeList *f, InkThreadCache *pCache)
 {
   if (!cfg_enable_reclaim)
     return false;
@@ -568,7 +559,7 @@ reclaimable_freelist_new(InkFreeList *f)
     if ((pNextCache = ThreadCaches[i]) == NULL)
       continue;
 
-    if (need_to_reclaim(pNextCache->f, pNextCache, THREAD_ID)) {
+    if (need_to_reclaim(pNextCache->f, pNextCache)) {
       if (cfg_debug_filter & 0x1)
         show_info("F", pNextCache->f, pNextCache);
 

Reply via email to