summaryrefslogtreecommitdiff
path: root/indra/llmessage/llbuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llbuffer.cpp')
-rwxr-xr-xindra/llmessage/llbuffer.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp
index aaa49d2ed6..d07d9980c3 100755
--- a/indra/llmessage/llbuffer.cpp
+++ b/indra/llmessage/llbuffer.cpp
@@ -32,8 +32,9 @@
#include "llmath.h"
#include "llstl.h"
#include "llthread.h"
+#include <iterator>
-#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED llassert(!mMutexp || mMutexp->isSelfLocked());
+#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED() llassert(!mMutexp || mMutexp->isSelfLocked())
/**
* LLSegment
@@ -180,8 +181,8 @@ bool LLHeapBuffer::reclaimSegment(const LLSegment& segment)
}
else if(mReclaimedBytes > mSize)
{
- llwarns << "LLHeapBuffer reclaimed more memory than allocated."
- << " This is probably programmer error." << llendl;
+ LL_WARNS() << "LLHeapBuffer reclaimed more memory than allocated."
+ << " This is probably programmer error." << LL_ENDL;
}
return true;
}
@@ -286,7 +287,7 @@ LLChannelDescriptors LLBufferArray::nextChannel()
//mMutexp should be locked before calling this.
S32 LLBufferArray::capacity() const
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
S32 total = 0;
const_buffer_iterator_t iter = mBuffers.begin();
@@ -314,7 +315,7 @@ bool LLBufferArray::append(S32 channel, const U8* src, S32 len)
//mMutexp should be locked before calling this.
bool LLBufferArray::prepend(S32 channel, const U8* src, S32 len)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
std::vector<LLSegment> segments;
if(copyIntoBuffers(channel, src, len, segments))
@@ -349,7 +350,7 @@ bool LLBufferArray::insertAfter(
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
segment_iterator_t end = mSegments.end();
segment_iterator_t it = getSegment(address);
@@ -381,14 +382,14 @@ LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::beginSegment()
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
return mSegments.begin();
}
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::endSegment()
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
return mSegments.end();
}
@@ -397,7 +398,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
U8* address,
LLSegment& segment)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
segment_iterator_t rv = mSegments.begin();
segment_iterator_t end = mSegments.end();
if(!address)
@@ -446,7 +447,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
segment_iterator_t end = mSegments.end();
if(!address)
{
@@ -468,7 +469,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address)
LLBufferArray::const_segment_iterator_t LLBufferArray::getSegment(
U8* address) const
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
const_segment_iterator_t end = mSegments.end();
if(!address)
{
@@ -623,7 +624,7 @@ U8* LLBufferArray::seek(
U8* start,
S32 delta) const
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
const_segment_iterator_t it;
const_segment_iterator_t end = mSegments.end();
U8* rv = start;
@@ -791,7 +792,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
S32 channel,
S32 len)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
// start at the end of the buffers, because it is the most likely
// to have free space.
LLSegment segment;
@@ -829,7 +830,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
//mMutexp should be locked before calling this.
bool LLBufferArray::eraseSegment(const segment_iterator_t& erase_iter)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
// Find out which buffer contains the segment, and if it is found,
// ask it to reclaim the memory.
@@ -861,7 +862,7 @@ bool LLBufferArray::copyIntoBuffers(
S32 len,
std::vector<LLSegment>& segments)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
if(!src || !len) return false;
S32 copied = 0;
LLSegment segment;