summaryrefslogtreecommitdiff
path: root/libutils/BasicHashtable.cpp
diff options
context:
space:
mode:
authorSergio Giro <sgiro@google.com>2015-09-23 16:22:59 +0100
committerSergio Giro <sgiro@google.com>2015-09-23 16:22:59 +0100
commitd2529f28308ba7583f4d8baaa937218d81cbe8bd (patch)
tree08e7ec119fa22c98d69f649e7ffa05f544a7d9f0 /libutils/BasicHashtable.cpp
parent1d758c90959225c76ed4d318290ad1bf11532409 (diff)
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
Diffstat (limited to 'libutils/BasicHashtable.cpp')
-rw-r--r--libutils/BasicHashtable.cpp8
1 files changed, 8 insertions, 0 deletions
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 <utils/BasicHashtable.h>
#include <utils/misc.h>
+#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);