From d2529f28308ba7583f4d8baaa937218d81cbe8bd Mon Sep 17 00:00:00 2001 From: Sergio Giro Date: Wed, 23 Sep 2015 16:22:59 +0100 Subject: libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory Some methods in header files of classes using SharedBuffer need to be moved to the implementation files accordingly Change-Id: I891f3ace2b940ab219e4e449040bfed71c0547db --- libutils/BasicHashtable.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libutils/BasicHashtable.cpp') diff --git a/libutils/BasicHashtable.cpp b/libutils/BasicHashtable.cpp index 491d9e98b..1e9f05333 100644 --- a/libutils/BasicHashtable.cpp +++ b/libutils/BasicHashtable.cpp @@ -22,6 +22,8 @@ #include #include +#include "SharedBuffer.h" + namespace android { BasicHashtableImpl::BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor, @@ -46,6 +48,12 @@ BasicHashtableImpl::~BasicHashtableImpl() { } +void BasicHashtableImpl::edit() { + if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) { + clone(); + } +} + void BasicHashtableImpl::dispose() { if (mBuckets) { releaseBuckets(mBuckets, mBucketCount); -- cgit v1.2.3