summaryrefslogtreecommitdiffstats
path: root/libutils/FileMap.cpp
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-02-23 15:43:35 +0000
committerNarayan Kamath <narayan@google.com>2015-02-23 15:49:43 +0000
commit6832a7a4e04c84192f0bafc6ac990fc79cd13882 (patch)
treee8c0940ae4a25e96db0ad84985991731f2b1b8f4 /libutils/FileMap.cpp
parentf1ac6917da172dd3e6829bac41fcbf23e96da079 (diff)
downloadsystem_core-6832a7a4e04c84192f0bafc6ac990fc79cd13882.tar.gz
system_core-6832a7a4e04c84192f0bafc6ac990fc79cd13882.tar.bz2
system_core-6832a7a4e04c84192f0bafc6ac990fc79cd13882.zip
Remove useless refCounting from FileMap.
Nobody ever called acquire() so release() was always equivalent to delete. Just use delete instead so that people can use unique_ptr directly (or shared_ptr if they really want refcounts). Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
Diffstat (limited to 'libutils/FileMap.cpp')
-rw-r--r--libutils/FileMap.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/libutils/FileMap.cpp b/libutils/FileMap.cpp
index 0af066f8b..91e45d873 100644
--- a/libutils/FileMap.cpp
+++ b/libutils/FileMap.cpp
@@ -48,7 +48,7 @@ using namespace android;
// Constructor. Create an empty object.
FileMap::FileMap(void)
- : mRefCount(1), mFileName(NULL), mBasePtr(NULL), mBaseLength(0),
+ : mFileName(NULL), mBasePtr(NULL), mBaseLength(0),
mDataPtr(NULL), mDataLength(0)
{
}
@@ -56,11 +56,6 @@ FileMap::FileMap(void)
// Destructor.
FileMap::~FileMap(void)
{
- assert(mRefCount == 0);
-
- //printf("+++ removing FileMap %p %zu\n", mDataPtr, mDataLength);
-
- mRefCount = -100; // help catch double-free
if (mFileName != NULL) {
free(mFileName);
}
@@ -134,7 +129,6 @@ bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t le
void* ptr;
- assert(mRefCount == 1);
assert(fd >= 0);
assert(offset >= 0);
assert(length > 0);