~ubuntu-branches/ubuntu/wily/trafficserver/wily

« back to all changes in this revision

Viewing changes to iocore/eventsystem/P_IOBuffer.h

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-12-17 22:28:16 UTC
  • mfrom: (5.1.8 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121217222816-7xwjsx5k76zkb63d
Tags: 3.2.0-1ubuntu1
* Revert FreeBSD strerror_r() fixes that give errors with glibc 2.16.
* Apply patch from Konstantinos Margaritis to define barriers on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
      _data = (char *) ioBufAllocator[size_index].alloc_void();
292
292
    // coverity[dead_error_condition]
293
293
    else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(size_index))
294
 
      // coverity[dead_error_line]
295
 
      _data = (char *) valloc(index_to_buffer_size(size_index));
 
294
      _data = (char *)ats_memalign(sysconf(_SC_PAGESIZE), index_to_buffer_size(size_index));
296
295
    break;
297
296
  default:
298
297
  case DEFAULT_ALLOC:
299
298
    if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(size_index))
300
299
      _data = (char *) ioBufAllocator[size_index].alloc_void();
301
300
    else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(size_index))
302
 
      _data = (char *) xmalloc(BUFFER_SIZE_FOR_XMALLOC(size_index));
 
301
      _data = (char *)ats_malloc(BUFFER_SIZE_FOR_XMALLOC(size_index));
303
302
    break;
304
303
  }
305
304
}
325
324
    if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(_size_index))
326
325
      ioBufAllocator[_size_index].free_void(_data);
327
326
    else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(_size_index))
328
 
      xfree(_data);
 
327
      ats_free(_data);
329
328
    break;
330
329
  }
331
330
  _data = 0;
523
522
TS_INLINE void
524
523
IOBufferBlock::realloc_xmalloc(int64_t buf_size)
525
524
{
526
 
  realloc_set_internal(xmalloc(buf_size), buf_size, -buf_size);
 
525
  realloc_set_internal(ats_malloc(buf_size), buf_size, -buf_size);
527
526
}
528
527
 
529
528
TS_INLINE void
1107
1106
TS_INLINE void
1108
1107
MIOBuffer::alloc_xmalloc(int64_t buf_size)
1109
1108
{
1110
 
  char *b = (char *) xmalloc(buf_size);
 
1109
  char *b = (char *)ats_malloc(buf_size);
1111
1110
  set_xmalloced(b, buf_size);
1112
1111
}
1113
1112