diff options
author | Mathias Agopian <mathias@google.com> | 2012-08-31 16:20:23 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-08-31 18:41:21 -0700 |
commit | 50f262fe569b52bb4d44c96de0d296188ce3885e (patch) | |
tree | 948e90f810ce098d3ef9d8fba27b7bf2e5bf810c /libs/utils | |
parent | 2401ead70099c982796ecc3ec63ec8a5570948fc (diff) | |
download | frameworks_native-50f262fe569b52bb4d44c96de0d296188ce3885e.zip frameworks_native-50f262fe569b52bb4d44c96de0d296188ce3885e.tar.gz frameworks_native-50f262fe569b52bb4d44c96de0d296188ce3885e.tar.bz2 |
minor SharedBuffer clean-up
Change-Id: If38b7ce85806ae628c00f2c938de4e3f75142543
Diffstat (limited to 'libs/utils')
-rw-r--r-- | libs/utils/VectorImpl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/utils/VectorImpl.cpp b/libs/utils/VectorImpl.cpp index 020ec15..8083bba 100644 --- a/libs/utils/VectorImpl.cpp +++ b/libs/utils/VectorImpl.cpp @@ -51,7 +51,7 @@ VectorImpl::VectorImpl(const VectorImpl& rhs) mFlags(rhs.mFlags), mItemSize(rhs.mItemSize) { if (mStorage) { - SharedBuffer::sharedBuffer(mStorage)->acquire(); + SharedBuffer::bufferFromData(mStorage)->acquire(); } } @@ -73,7 +73,7 @@ VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) if (rhs.mCount) { mStorage = rhs.mStorage; mCount = rhs.mCount; - SharedBuffer::sharedBuffer(mStorage)->acquire(); + SharedBuffer::bufferFromData(mStorage)->acquire(); } else { mStorage = 0; mCount = 0; @@ -85,7 +85,7 @@ VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) void* VectorImpl::editArrayImpl() { if (mStorage) { - SharedBuffer* sb = SharedBuffer::sharedBuffer(mStorage)->attemptEdit(); + SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage)->attemptEdit(); if (sb == 0) { sb = SharedBuffer::alloc(capacity() * mItemSize); if (sb) { @@ -101,7 +101,7 @@ void* VectorImpl::editArrayImpl() size_t VectorImpl::capacity() const { if (mStorage) { - return SharedBuffer::sharedBuffer(mStorage)->size() / mItemSize; + return SharedBuffer::bufferFromData(mStorage)->size() / mItemSize; } return 0; } @@ -346,7 +346,7 @@ ssize_t VectorImpl::setCapacity(size_t new_capacity) void VectorImpl::release_storage() { if (mStorage) { - const SharedBuffer* sb = SharedBuffer::sharedBuffer(mStorage); + const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); if (sb->release(SharedBuffer::eKeepStorage) == 1) { _do_destroy(mStorage, mCount); SharedBuffer::dealloc(sb); @@ -372,7 +372,7 @@ void* VectorImpl::_grow(size_t where, size_t amount) (mFlags & HAS_TRIVIAL_COPY) && (mFlags & HAS_TRIVIAL_DTOR)) { - const SharedBuffer* cur_sb = SharedBuffer::sharedBuffer(mStorage); + const SharedBuffer* cur_sb = SharedBuffer::bufferFromData(mStorage); SharedBuffer* sb = cur_sb->editResize(new_capacity * mItemSize); mStorage = sb->data(); } else { @@ -424,7 +424,7 @@ void VectorImpl::_shrink(size_t where, size_t amount) (mFlags & HAS_TRIVIAL_COPY) && (mFlags & HAS_TRIVIAL_DTOR)) { - const SharedBuffer* cur_sb = SharedBuffer::sharedBuffer(mStorage); + const SharedBuffer* cur_sb = SharedBuffer::bufferFromData(mStorage); SharedBuffer* sb = cur_sb->editResize(new_capacity * mItemSize); mStorage = sb->data(); } else { |