trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1166441 - in /trafficserver/traffic/trunk: iocore/cache/ iocore/cluster/ lib/records/ lib/ts/ mgmt/api/ mgmt/utils/ proxy/ proxy/hdrs/
Date Wed, 07 Sep 2011 22:09:19 GMT
Author: zwoop
Date: Wed Sep  7 22:09:18 2011
New Revision: 1166441

URL: http://svn.apache.org/viewvc?rev=1166441&view=rev
Log:
TS-567 Change xrealloc to ats_realloc

Modified:
    trafficserver/traffic/trunk/iocore/cache/I_Store.h
    trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
    trafficserver/traffic/trunk/lib/records/RecMessage.cc
    trafficserver/traffic/trunk/lib/ts/TextBuffer.cc
    trafficserver/traffic/trunk/lib/ts/ink_killall.cc
    trafficserver/traffic/trunk/lib/ts/ink_resource.cc
    trafficserver/traffic/trunk/lib/ts/ink_resource.h
    trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc
    trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc
    trafficserver/traffic/trunk/mgmt/utils/ExpandingArray.cc
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/Show.h
    trafficserver/traffic/trunk/proxy/StatPages.cc
    trafficserver/traffic/trunk/proxy/hdrs/MIME.cc

Modified: trafficserver/traffic/trunk/iocore/cache/I_Store.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/I_Store.h?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/I_Store.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/I_Store.h Wed Sep  7 22:09:18 2011
@@ -134,7 +134,7 @@ struct Store
   void extend(int i)
   {
     if (i > n_disks) {
-      disk = (Span **) xrealloc(disk, i * sizeof(Span *));
+      disk = (Span **)ats_realloc(disk, i * sizeof(Span *));
       for (int j = n_disks; j < i; j++)
         disk[j] = NULL;
       n_disks = i;

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc Wed Sep  7 22:09:18 2011
@@ -649,12 +649,10 @@ bool ClusterHandler::check_channel(int c
       }
     }
     // Allocate ClusterVConnection table entries
-    channels = (ClusterVConnection **)
-      xrealloc(channels, n_channels * sizeof(ClusterVConnection *));
+    channels = (ClusterVConnection **)ats_realloc(channels, n_channels * sizeof(ClusterVConnection
*));
 
     // Allocate ChannelData table entries
-    channel_data = (struct ChannelData **)
-      xrealloc(channel_data, n_channels * sizeof(struct ChannelData *));
+    channel_data = (struct ChannelData **)ats_realloc(channel_data, n_channels * sizeof(struct
ChannelData *));
 
     for (int i = old_channels; i < n_channels; i++) {
       if (local_channel(i)) {

Modified: trafficserver/traffic/trunk/lib/records/RecMessage.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecMessage.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecMessage.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecMessage.cc Wed Sep  7 22:09:18 2011
@@ -338,7 +338,7 @@ RecMessageMarshal_Realloc(RecMessage * m
   // get some space in our buffer
   while (msg->o_end - msg->o_write < msg_ele_size) {
     int realloc_size = (msg->o_end - msg->o_start) * 2;
-    msg = (RecMessage *) xrealloc(msg, sizeof(RecMessageHdr) + realloc_size);
+    msg = (RecMessage *)ats_realloc(msg, sizeof(RecMessageHdr) + realloc_size);
     msg->o_end = msg->o_start + realloc_size;
   }
   ele_hdr = (RecMessageEleHdr *) ((char *) msg + msg->o_write);

Modified: trafficserver/traffic/trunk/lib/ts/TextBuffer.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/TextBuffer.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/TextBuffer.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/TextBuffer.cc Wed Sep  7 22:09:18 2011
@@ -125,7 +125,7 @@ textBuffer::enlargeBuffer(int N)
       newSize *= 2;
     }
 
-    newSpace = (char *) xrealloc(bufferStart, newSize);
+    newSpace = (char *)ats_realloc(bufferStart, newSize);
     if (newSpace != NULL) {
       nextAdd = newSpace + (unsigned int) (nextAdd - bufferStart);
       bufferStart = newSpace;

Modified: trafficserver/traffic/trunk/lib/ts/ink_killall.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_killall.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_killall.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_killall.cc Wed Sep  7 22:09:18 2011
@@ -97,7 +97,7 @@ ink_killall_get_pidv_xmalloc(const char 
           if (*pidvcnt >= pidvsize) {
             pid_t *pidv_realloc;
             pidvsize *= 2;
-            if (!(pidv_realloc = (pid_t *) xrealloc(*pidv, pidvsize * sizeof(pid_t)))) {
+            if (!(pidv_realloc = (pid_t *)ats_realloc(*pidv, pidvsize * sizeof(pid_t))))
{
               ats_free(*pidv);
               goto l_error;
             } else {

Modified: trafficserver/traffic/trunk/lib/ts/ink_resource.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_resource.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_resource.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_resource.cc Wed Sep  7 22:09:18 2011
@@ -33,13 +33,6 @@ volatile int res_track_memory = RES_TRAC
 
 /*-------------------------------------------------------------------------
 -------------------------------------------------------------------------*/
-void *
-_xrealloc(void *ptr, unsigned int size, const char *path)
-{
-  NOWARN_UNUSED(path);
-  return ats_realloc(ptr, size);
-}
-
 char *
 _xstrdup(const char *str, int length, const char *path)
 {

Modified: trafficserver/traffic/trunk/lib/ts/ink_resource.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_resource.h?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_resource.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_resource.h Wed Sep  7 22:09:18 2011
@@ -54,11 +54,9 @@ struct Resource
 #define RES_TRACK_MEMORY_DEFAULT 0      /* default value for res_track_memory variable */
 
 
-#define xrealloc(p,s)     ats_realloc ((p),(s))
 #define xstrdup(p)        _xstrdup ((p), -1, NULL)
 #define xstrndup(p,n)     _xstrdup ((p), n, NULL)
 
-void *_xrealloc(void *ptr, unsigned int size, const char *path);
 char *_xstrdup(const char *str, int length, const char *path);
 
 void xdump(void);

Modified: trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc Wed Sep  7 22:09:18 2011
@@ -119,7 +119,7 @@ CfgContextCommit(CfgContext * ctx, LLQ *
     size += len + 1;
     if (size > max_file_size) {
       max_file_size *= 2;
-      new_text = (char *) xrealloc(new_text, max_file_size + 1);
+      new_text = (char *)ats_realloc(new_text, max_file_size + 1);
       if (!new_text) {          // out of memory
         return TS_ERR_FAIL;
       }

Modified: trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc Wed Sep  7 22:09:18 2011
@@ -58,7 +58,7 @@ _TSmalloc(unsigned int size, const char 
 void *
 _TSrealloc(void *ptr, unsigned int size, const char *path)
 {
-  return xrealloc(ptr, size);
+  return ats_realloc(ptr, size);
 }
 
 char *

Modified: trafficserver/traffic/trunk/mgmt/utils/ExpandingArray.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/utils/ExpandingArray.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/utils/ExpandingArray.cc (original)
+++ trafficserver/traffic/trunk/mgmt/utils/ExpandingArray.cc Wed Sep  7 22:09:18 2011
@@ -68,7 +68,7 @@ ExpandingArray::addEntry(void *entry)
 
   if (numValidValues == internalArraySize) {
     // Time to increase the size of the array
-    internalArray = (void **) xrealloc(internalArray, 2 * sizeof(void *) * internalArraySize);
+    internalArray = (void **)ats_realloc(internalArray, 2 * sizeof(void *) * internalArraySize);
     internalArraySize *= 2;
   }
 

Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Wed Sep  7 22:09:18 2011
@@ -762,7 +762,7 @@ FileImpl::fread(void *buf, int length)
       while (amount > (m_bufsize - m_bufpos)) {
         m_bufsize *= 2;
       }
-      m_buf = (char *) xrealloc(m_buf, m_bufsize);
+      m_buf = (char *)ats_realloc(m_buf, m_bufsize);
     }
 
     do {
@@ -1649,7 +1649,8 @@ _TSmalloc(size_t size, const char *path)
 void *
 _TSrealloc(void *ptr, size_t size, const char *path)
 {
-  return _xrealloc(ptr, size, path);
+  NOWARN_UNUSED(path);
+  return ats_realloc(ptr, size);
 }
 
 // length has to be int64_t and not size_t, since -1 means to call strlen() to get length

Modified: trafficserver/traffic/trunk/proxy/Show.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Show.h?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Show.h (original)
+++ trafficserver/traffic/trunk/proxy/Show.h Wed Sep  7 22:09:18 2011
@@ -54,7 +54,7 @@ struct ShowCont: public Continuation
     va_end(va_scratch);
     if (done > l - 256)
     {
-      char *start2 = (char *) xrealloc(start, (ebuf - start) * 2);
+      char *start2 = (char *)ats_realloc(start, (ebuf - start) * 2);
         ebuf = start2 + (ebuf - start) * 2;
         buf = start2 + (buf - start);
         start = start2;

Modified: trafficserver/traffic/trunk/proxy/StatPages.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/StatPages.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/StatPages.cc (original)
+++ trafficserver/traffic/trunk/proxy/StatPages.cc Wed Sep  7 22:09:18 2011
@@ -163,7 +163,7 @@ BaseStatPagesHandler::resp_add(const cha
     if (!response) {
       response = (char *)ats_malloc(size);
     } else {
-      response = (char *) xrealloc(response, size);
+      response = (char *)ats_realloc(response, size);
     }
     response_size = size;
   }

Modified: trafficserver/traffic/trunk/proxy/hdrs/MIME.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/MIME.cc?rev=1166441&r1=1166440&r2=1166441&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/MIME.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/MIME.cc Wed Sep  7 22:09:18 2011
@@ -2358,7 +2358,7 @@ mime_scanner_append(MIMEScanner * scanne
     if (scanner->m_line == NULL) {       // if no buffer yet, allocate one
       scanner->m_line = (char *)ats_malloc(scanner->m_line_size);
     } else {
-      scanner->m_line = (char *) xrealloc(scanner->m_line, scanner->m_line_size);
+      scanner->m_line = (char *)ats_realloc(scanner->m_line, scanner->m_line_size);
     }
   }
   ////////////////////////////////////////////////



Mime
View raw message