trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1166276 - in /trafficserver/traffic/trunk: iocore/cluster/ iocore/eventsystem/ lib/records/ lib/ts/ mgmt/ mgmt/utils/ proxy/ proxy/hdrs/ proxy/logging/
Date Wed, 07 Sep 2011 17:28:03 GMT
Author: zwoop
Date: Wed Sep  7 17:26:37 2011
New Revision: 1166276

URL: http://svn.apache.org/viewvc?rev=1166276&view=rev
Log:
TS-567 Fourth set of xmalloc -> ats_malloc conversion

Modified:
    trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
    trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h
    trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h
    trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
    trafficserver/traffic/trunk/lib/records/P_RecCore.i
    trafficserver/traffic/trunk/lib/records/RecCore.cc
    trafficserver/traffic/trunk/lib/records/RecMessage.cc
    trafficserver/traffic/trunk/lib/records/RecProcess.cc
    trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc
    trafficserver/traffic/trunk/lib/ts/ink_string++.cc
    trafficserver/traffic/trunk/mgmt/Main.cc
    trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc
    trafficserver/traffic/trunk/proxy/Show.h
    trafficserver/traffic/trunk/proxy/SocksProxy.cc
    trafficserver/traffic/trunk/proxy/hdrs/URL.cc
    trafficserver/traffic/trunk/proxy/logcat.cc
    trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc
    trafficserver/traffic/trunk/proxy/logging/LogFile.cc

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc Wed Sep  7 17:26:37 2011
@@ -2692,7 +2692,7 @@ CacheContinuation::replyLookupEvent(int 
     CacheOpReplyMsg *msg;
     int flen = CacheOpReplyMsg::sizeof_fixedlen_msg();
 #ifdef PURIFY
-    msg = (CacheOpReplyMsg *) xmalloc(flen);
+    msg = (CacheOpReplyMsg *)ats_malloc(flen);
 #else
     msg = (CacheOpReplyMsg *) ALLOCA_DOUBLE(flen);
 #endif

Modified: trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h Wed Sep  7 17:26:37 2011
@@ -837,7 +837,7 @@ public:
   /**
     Adds by reference len bytes of data pointed to by b to the end
     of the buffer.  b MUST be a pointer to the beginning of  block
-    allocated from the xmalloc() routine. The data will be deallocated
+    allocated from the ats_xmalloc() routine. The data will be deallocated
     by the buffer once all readers on the buffer have consumed it.
 
   */

Modified: trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h Wed Sep  7 17:26:37 2011
@@ -299,7 +299,7 @@ IOBufferData::alloc(int64_t size_index, 
     if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(size_index))
       _data = (char *) ioBufAllocator[size_index].alloc_void();
     else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(size_index))
-      _data = (char *) xmalloc(BUFFER_SIZE_FOR_XMALLOC(size_index));
+      _data = (char *)ats_malloc(BUFFER_SIZE_FOR_XMALLOC(size_index));
     break;
   }
 }
@@ -1107,7 +1107,7 @@ MIOBuffer::alloc(int64_t i)
 TS_INLINE void
 MIOBuffer::alloc_xmalloc(int64_t buf_size)
 {
-  char *b = (char *) xmalloc(buf_size);
+  char *b = (char *)ats_malloc(buf_size);
   set_xmalloced(b, buf_size);
 }
 

Modified: trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc Wed Sep  7 17:26:37 2011
@@ -63,7 +63,7 @@ EThread::EThread(ThreadType att, int ani
     tt(att),
     eventsem(NULL)
 {
-  ethreads_to_be_signalled = (EThread **) xmalloc(MAX_EVENT_THREADS * sizeof(EThread *));
+  ethreads_to_be_signalled = (EThread **)ats_malloc(MAX_EVENT_THREADS * sizeof(EThread *));
   memset((char *) ethreads_to_be_signalled, 0, MAX_EVENT_THREADS * sizeof(EThread *));
   memset(thread_private, 0, PER_THREAD_DATA);
 #if TS_HAS_EVENTFD

Modified: trafficserver/traffic/trunk/lib/records/P_RecCore.i
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/P_RecCore.i?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/P_RecCore.i (original)
+++ trafficserver/traffic/trunk/lib/records/P_RecCore.i Wed Sep  7 17:26:37 2011
@@ -754,7 +754,7 @@ RecReadConfigFile()
     RecDataClear(data_type, &data);
 
     // update our g_rec_config_contents_xxx
-    cfe = (RecConfigFileEntry *) xmalloc(sizeof(RecConfigFileEntry));
+    cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
     cfe->entry_type = RECE_RECORD;
     cfe->entry = xstrdup(name_str);
     enqueue(g_rec_config_contents_llq, (void *) cfe);
@@ -764,7 +764,7 @@ RecReadConfigFile()
   L_next_line:
     // store this line into g_rec_config_contents_llq so that we can
     // write it out later
-    cfe = (RecConfigFileEntry *) xmalloc(sizeof(RecConfigFileEntry));
+    cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
     cfe->entry_type = RECE_COMMENT;
     cfe->entry = xstrdup(line);
     enqueue(g_rec_config_contents_llq, (void *) cfe);
@@ -810,7 +810,7 @@ RecSyncConfigToTB(textBuffer * tb)
       if (REC_TYPE_IS_CONFIG(r->rec_type)) {
         if (r->sync_required & REC_DISK_SYNC_REQUIRED) {
           if (!ink_hash_table_isbound(g_rec_config_contents_ht, r->name)) {
-            cfe = (RecConfigFileEntry *) xmalloc(sizeof(RecConfigFileEntry));
+            cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
             cfe->entry_type = RECE_RECORD;
             cfe->entry = xstrdup(r->name);
             enqueue(g_rec_config_contents_llq, (void *) cfe);

Modified: trafficserver/traffic/trunk/lib/records/RecCore.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecCore.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecCore.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecCore.cc Wed Sep  7 17:26:37 2011
@@ -165,7 +165,7 @@ link_string_alloc(const char *name, RecD
   int len = -1;
   if (_ss) {
     len = strlen(_ss);
-    _new_value = (RecString) xmalloc(len + 1);
+    _new_value = (RecString)ats_malloc(len + 1);
     memcpy(_new_value, _ss, len + 1);
   }
 
@@ -197,7 +197,7 @@ RecCoreInit(RecModeT mode_type, Diags *_
   g_num_records = 0;
 
   // initialize record array for our internal stats (this can be reallocated later)
-  g_records = (RecRecord *) xmalloc(REC_MAX_RECORDS * sizeof(RecRecord));
+  g_records = (RecRecord *)ats_malloc(REC_MAX_RECORDS * sizeof(RecRecord));
   memset(g_records, 0, REC_MAX_RECORDS * sizeof(RecRecord));
 
   // initialize record hash index
@@ -342,7 +342,7 @@ RecRegisterConfigUpdateCb(const char *na
          }
        */
 
-      RecConfigUpdateCbList *new_callback = (RecConfigUpdateCbList *) xmalloc(sizeof(RecConfigUpdateCbList));
+      RecConfigUpdateCbList *new_callback = (RecConfigUpdateCbList *)ats_malloc(sizeof(RecConfigUpdateCbList));
       memset(new_callback, 0, sizeof(RecConfigUpdateCbList));
       new_callback->update_cb = update_cb;
       new_callback->update_cookie = cookie;
@@ -642,7 +642,7 @@ RecGetRecordDefaultDataString_Xmalloc(ch
   RecRecord *r = NULL;
 
   if (ink_hash_table_lookup(g_records_ht, name, (void **) &r)) {
-    *buf = (char *) xmalloc(sizeof(char) * 1024);
+    *buf = (char *)ats_malloc(sizeof(char) * 1024);
     memset(*buf, 0, 1024);
     err = REC_ERR_OKAY;
 
@@ -950,7 +950,7 @@ RecGetRecordPrefix_Xmalloc(char *prefix,
   int num_matched = 0;
   char *result = NULL;
 
-  result = (char *) xmalloc(result_size * sizeof(char));
+  result = (char *)ats_malloc(result_size * sizeof(char));
   memset(result, 0, result_size * sizeof(char));
 
   int i;

Modified: trafficserver/traffic/trunk/lib/records/RecMessage.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecMessage.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecMessage.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecMessage.cc Wed Sep  7 17:26:37 2011
@@ -80,7 +80,7 @@ recv_thr(void *data)
     if (RecPipeRead(h_pipe, (char *) (&msg_hdr), sizeof(RecMessageHdr)) == REC_ERR_FAIL)
{
       ink_release_assert("Pipe read failed");
     }
-    msg = (RecMessage *) xmalloc((msg_hdr.o_end - msg_hdr.o_start) + sizeof(RecMessageHdr));
+    msg = (RecMessage *)ats_malloc((msg_hdr.o_end - msg_hdr.o_start) + sizeof(RecMessageHdr));
     memcpy(msg, &msg_hdr, sizeof(RecMessageHdr));
     if (RecPipeRead(h_pipe, (char *) (msg) + msg_hdr.o_start, msg_hdr.o_end - msg_hdr.o_start)
== REC_ERR_FAIL) {
       ink_release_assert("Pipe read failed");
@@ -185,7 +185,7 @@ RecMessageSend(RecMessage * msg)
   // Make a copy of the record, but truncate it to the size actually used
   if (g_mode_type == RECM_CLIENT || g_mode_type == RECM_SERVER) {
     msg_cpy_size = sizeof(RecMessageHdr) + (msg->o_write - msg->o_start);
-    msg_cpy = (RecMessage *) xmalloc(msg_cpy_size);
+    msg_cpy = (RecMessage *)ats_malloc(msg_cpy_size);
     memcpy(msg_cpy, msg, msg_cpy_size);
     msg_cpy->o_end = msg_cpy->o_write;
     enqueue(g_send_llq, (void *) msg_cpy);
@@ -272,7 +272,7 @@ RecMessageAlloc(RecMessageT msg_type, in
 {
   RecMessage *msg;
 
-  msg = (RecMessage *) xmalloc(sizeof(RecMessageHdr) + initial_size);
+  msg = (RecMessage *)ats_malloc(sizeof(RecMessageHdr) + initial_size);
   memset(msg, 0, sizeof(RecMessageHdr) + initial_size);
   msg->msg_type = msg_type;
   msg->o_start = sizeof(RecMessageHdr);
@@ -501,7 +501,7 @@ RecMessageReadFromDisk(const char *fpath
   if (RecFileRead(h_file, (char *) (&msg_hdr), sizeof(RecMessageHdr), &bytes_read)
== REC_ERR_FAIL) {
     goto Lerror;
   }
-  msg = (RecMessage *) xmalloc((msg_hdr.o_end - msg_hdr.o_start) + sizeof(RecMessageHdr));
+  msg = (RecMessage *)ats_malloc((msg_hdr.o_end - msg_hdr.o_start) + sizeof(RecMessageHdr));
   memcpy(msg, &msg_hdr, sizeof(RecMessageHdr));
   if (RecFileRead(h_file, (char *) (msg) + msg_hdr.o_start,
                   msg_hdr.o_end - msg_hdr.o_start, &bytes_read) == REC_ERR_FAIL) {

Modified: trafficserver/traffic/trunk/lib/records/RecProcess.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecProcess.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecProcess.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecProcess.cc Wed Sep  7 17:26:37 2011
@@ -394,10 +394,10 @@ RecAllocateRawStatBlock(int num_stats)
     return NULL;
   }
   // create the raw-stat-block structure
-  rsb = (RecRawStatBlock *) xmalloc(sizeof(RecRawStatBlock));
+  rsb = (RecRawStatBlock *)ats_malloc(sizeof(RecRawStatBlock));
   memset(rsb, 0, sizeof(RecRawStatBlock));
   rsb->ethr_stat_offset = ethr_stat_offset;
-  rsb->global = (RecRawStat **) xmalloc(num_stats * sizeof(RecRawStat *));
+  rsb->global = (RecRawStat **)ats_malloc(num_stats * sizeof(RecRawStat *));
   memset(rsb->global, 0, num_stats * sizeof(RecRawStat *));
   rsb->num_stats = 0;
   rsb->max_stats = num_stats;

Modified: trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc Wed Sep  7 17:26:37 2011
@@ -73,26 +73,23 @@ readIntoBuffer(char *file_path, const ch
   // Allocate a buffer large enough to hold the entire file
   //   File size should be small and this makes it easy to
   //   do two passes on the file
-  if ((file_buf = (char *) xmalloc((file_info.st_size + 1))) != NULL) {
-    // Null terminate the buffer so that string operations will work
-    file_buf[file_info.st_size] = '\0';
-
-    read_size = (file_info.st_size > 0) ? read(fd, file_buf, file_info.st_size) : 0;
-
-    // Check to make sure that we got the whole file
-    if (read_size < 0) {
-      Error("%s Read of %s file failed : %s", module_name, file_path, strerror(errno));
-      xfree(file_buf);
-      file_buf = NULL;
-    } else if (read_size < file_info.st_size) {
-      // We don't want to signal this error on WIN32 because the sizes
-      // won't match if the file contains any CR/LF sequence.
-      Error("%s Only able to read %d bytes out %d for %s file",
-            module_name, read_size, (int) file_info.st_size, file_path);
-      file_buf[read_size] = '\0';
-    }
-  } else {
-    Error("%s Insufficient memory to read %s file", module_name, file_path);
+  file_buf = (char *)ats_malloc(file_info.st_size + 1);
+  // Null terminate the buffer so that string operations will work
+  file_buf[file_info.st_size] = '\0';
+
+  read_size = (file_info.st_size > 0) ? read(fd, file_buf, file_info.st_size) : 0;
+
+  // Check to make sure that we got the whole file
+  if (read_size < 0) {
+    Error("%s Read of %s file failed : %s", module_name, file_path, strerror(errno));
+    xfree(file_buf);
+    file_buf = NULL;
+  } else if (read_size < file_info.st_size) {
+    // We don't want to signal this error on WIN32 because the sizes
+    // won't match if the file contains any CR/LF sequence.
+    Error("%s Only able to read %d bytes out %d for %s file",
+          module_name, read_size, (int) file_info.st_size, file_path);
+    file_buf[read_size] = '\0';
   }
 
   if (file_buf && read_size_ptr) {

Modified: trafficserver/traffic/trunk/lib/ts/ink_string++.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_string%2B%2B.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_string++.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_string++.cc Wed Sep  7 17:26:37 2011
@@ -180,14 +180,14 @@ StrListOverflow *
 StrListOverflow::create_heap(int user_size)
 {
   // I'm aligning the first allocation since the old implementation
-  //  used to do this by calling xmalloc.  I assume it doesn't
+  //  used to do this by calling ats_malloc.  I assume it doesn't
   //  matter since we are talking about strings but since this is a
   //  last minute emergency bug fix, I'm not take any changes.  If
   //  allocations are not of aligned values then subsequents allocations
   //  aren't aligned, again mirroring the previous implemnetation
   int total_size = overflow_head_hdr_size + user_size;
 
-  StrListOverflow *o = (StrListOverflow *) xmalloc(total_size);
+  StrListOverflow *o = (StrListOverflow *)ats_malloc(total_size);
   o->init();
   o->heap_size = user_size;
 

Modified: trafficserver/traffic/trunk/mgmt/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Main.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Main.cc (original)
+++ trafficserver/traffic/trunk/mgmt/Main.cc Wed Sep  7 17:26:37 2011
@@ -546,7 +546,7 @@ main(int argc, char **argv)
               size_of_args += 1;
               size_of_args += strlen((argv[j++]));
             }
-            ink_assert((tsArgs = (char *) xmalloc(size_of_args + 1)));
+            tsArgs = (char *)ats_malloc(size_of_args + 1);
 
             j = 0;
             while (i < argc) {

Modified: trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc (original)
+++ trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc Wed Sep  7 17:26:37 2011
@@ -1428,7 +1428,7 @@ getFilesInDirectory(char *managedDir, Ex
   // The fun of Solaris - readdir_r requires a buffer passed into it
   //   The man page says this obscene expression gives us the proper
   //     size
-  dirEntry = (struct dirent *) xmalloc(sizeof(struct dirent) + pathconf(".", _PC_NAME_MAX)
+ 1);
+  dirEntry = (struct dirent *)ats_malloc(sizeof(struct dirent) + pathconf(".", _PC_NAME_MAX)
+ 1);
 
   struct dirent *result;
   while (readdir_r(dir, dirEntry, &result) == 0) {
@@ -1444,7 +1444,7 @@ getFilesInDirectory(char *managedDir, Ex
     } else {
       // Ignore ., .., and any dot files
       if (fileName && *fileName != '.') {
-        fileListEntry = (fileEntry *) xmalloc(sizeof(fileEntry));
+        fileListEntry = (fileEntry *)ats_malloc(sizeof(fileEntry));
         fileListEntry->c_time = fileInfo.st_ctime;
         ink_strncpy(fileListEntry->name, fileName, FILE_NAME_MAX);
         fileList->addEntry(fileListEntry);
@@ -1475,7 +1475,7 @@ getFilesInDirectory(char *managedDir, Ex
     } else {
       // Ignore ., .., and any dot files
       if (fileName && *fileName != '.') {
-        fileListEntry = (fileEntry *) xmalloc(sizeof(fileEntry));
+        fileListEntry = (fileEntry *)ats_malloc(sizeof(fileEntry));
         fileListEntry->c_time = fileInfo.st_ctime;
         strcpy(fileListEntry->name, fileName);
         fileList->addEntry(fileListEntry);

Modified: trafficserver/traffic/trunk/proxy/Show.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Show.h?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Show.h (original)
+++ trafficserver/traffic/trunk/proxy/Show.h Wed Sep  7 17:26:37 2011
@@ -127,7 +127,7 @@ ShowCont(Continuation * c, HTTPHdr * h):
     NOWARN_UNUSED(h);
     mutex = c->mutex;
     action = c;
-    buf = (char *) xmalloc(32000);
+    buf = (char *)ats_malloc(32000);
     start = buf;
     ebuf = buf + 32000;
   }

Modified: trafficserver/traffic/trunk/proxy/SocksProxy.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/SocksProxy.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/SocksProxy.cc (original)
+++ trafficserver/traffic/trunk/proxy/SocksProxy.cc Wed Sep  7 17:26:37 2011
@@ -461,12 +461,12 @@ SocksProxy::setupHttpRequest(unsigned ch
 
   case SOCKS_ATYPE_FQHN:
     //This is stored as a zero terminicated string
-    a->addr.buf = (unsigned char *) xmalloc(p[4] + 1);
+    a->addr.buf = (unsigned char *)ats_malloc(p[4] + 1);
     memcpy(a->addr.buf, &p[5], p[4]);
     a->addr.buf[p[4]] = 0;
     break;
   case SOCKS_ATYPE_IPV6:
-    //a->addr.buf = (unsigned char *) xmalloc(16);
+    //a->addr.buf = (unsigned char *)ats_malloc(16);
     //memcpy(a->addr.buf, &p[4], 16);
     //dont think we will use "proper" IPv6 addr anytime soon.
     //just use the last 4 octets as IPv4 addr:

Modified: trafficserver/traffic/trunk/proxy/hdrs/URL.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/URL.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/URL.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/URL.cc Wed Sep  7 17:26:37 2011
@@ -589,7 +589,7 @@ url_string_get(URLImpl * url, Arena * ar
   int index = 0;
   int offset = 0;
 
-  buf = arena ? arena->str_alloc(len) : (char *) xmalloc(len + 1);
+  buf = arena ? arena->str_alloc(len) : (char *)ats_malloc(len + 1);
 
   url_print(url, buf, len, &index, &offset);
   buf[len] = '\0';
@@ -811,7 +811,7 @@ url_to_string(URLImpl * url, Arena * are
   if (arena)
     str = arena->str_alloc(len);
   else
-    str = (char *) xmalloc(len + 1);
+    str = (char *)ats_malloc(len + 1);
 
   idx = 0;
 

Modified: trafficserver/traffic/trunk/proxy/logcat.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logcat.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logcat.cc (original)
+++ trafficserver/traffic/trunk/proxy/logcat.cc Wed Sep  7 17:26:37 2011
@@ -315,7 +315,7 @@ main(int argc, char *argv[])
                                                      BINARY_LOG_OBJECT_FILENAME_EXTENSION)
==
                                               0 ? n - bin_ext_len : n) : n);
 
-          char *out_filename = (char *) xmalloc(copy_len + ascii_ext_len + 1);
+          char *out_filename = (char *)ats_malloc(copy_len + ascii_ext_len + 1);
 
           memcpy(out_filename, file_arguments[i], copy_len);
           memcpy(&out_filename[copy_len], ASCII_LOG_OBJECT_FILENAME_EXTENSION, ascii_ext_len);

Modified: trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc Wed Sep  7 17:26:37 2011
@@ -113,12 +113,8 @@ iLogBufferBuffer::New_iLogBufferBuffer(s
     if (!ob) {
       ob = new iLogBufferBuffer();
       if (ob) {
-        if ((ob->buf = (char *) xmalloc(_buf_size)) == 0) {
-          delete ob;
-          ob = 0;
-        } else {
-          ob->real_buf_size = _buf_size;
-        }
+        ob->buf = (char *)ats_malloc(_buf_size);
+        ob->real_buf_size = _buf_size;
       }
     }
 
@@ -178,7 +174,7 @@ iObject::operator new(size_t _size)
   ink_mutex_release(&iObjectMutex);
 
   if (!ob)
-    ob = (iObject *) xmalloc(_size);
+    ob = (iObject *)ats_malloc(_size);
 
   if (likely(ob)) {
     memset(ob, 0, _size);
@@ -629,10 +625,9 @@ LogBuffer::resolve_custom_entry(LogField
   if (alt_fieldlist && alt_printf_str) {
     LogField *f, *g;
     int n_alt_fields = alt_fieldlist->count();
-    if (unlikely((readfrom_map = (int *) xmalloc(n_alt_fields * sizeof(int))) == NULL))
-      return 0;
     int i = 0;
 
+    readfrom_map = (int *)ats_malloc(n_alt_fields * sizeof(int));
     for (f = alt_fieldlist->first(); f; f = alt_fieldlist->next(f)) {
       int readfrom_pos = 0;
       bool found_match = false;

Modified: trafficserver/traffic/trunk/proxy/logging/LogFile.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFile.cc?rev=1166276&r1=1166275&r2=1166276&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFile.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFile.cc Wed Sep  7 17:26:37 2011
@@ -886,7 +886,7 @@ MetaInfo::_build_name(const char *filena
 
   // 7 = 1 (dot at beginning) + 5 (".meta") + 1 (null terminating)
   //
-  _filename = (char *) xmalloc(l + 7);
+  _filename = (char *)ats_malloc(l + 7);
 
   if (i < 0) {
     ink_string_concatenate_strings(_filename, ".", filename, ".meta", NULL);



Mime
View raw message