Merge "Mount /vendor and /odm early"
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp
index 4b498c1..ae38519 100644
--- a/libpixelflinger/codeflinger/CodeCache.cpp
+++ b/libpixelflinger/codeflinger/CodeCache.cpp
@@ -23,7 +23,6 @@
#include <sys/mman.h>
#include <cutils/ashmem.h>
-#include <cutils/atomic.h>
#define LOG_TAG "CodeCache"
#include <cutils/log.h>
@@ -101,7 +100,7 @@
}
Assembly::Assembly(size_t size)
- : mCount(1), mSize(0)
+ : mCount(0), mSize(0)
{
mBase = (uint32_t*)mspace_malloc(getMspace(), size);
LOG_ALWAYS_FATAL_IF(mBase == NULL,
@@ -117,12 +116,12 @@
void Assembly::incStrong(const void*) const
{
- android_atomic_inc(&mCount);
+ mCount.fetch_add(1, std::memory_order_relaxed);
}
void Assembly::decStrong(const void*) const
{
- if (android_atomic_dec(&mCount) == 1) {
+ if (mCount.fetch_sub(1, std::memory_order_acq_rel) == 1) {
delete this;
}
}
diff --git a/libpixelflinger/codeflinger/CodeCache.h b/libpixelflinger/codeflinger/CodeCache.h
index c0e0684..9326453 100644
--- a/libpixelflinger/codeflinger/CodeCache.h
+++ b/libpixelflinger/codeflinger/CodeCache.h
@@ -19,6 +19,7 @@
#ifndef ANDROID_CODECACHE_H
#define ANDROID_CODECACHE_H
+#include <atomic>
#include <stdint.h>
#include <pthread.h>
#include <sys/types.h>
@@ -69,7 +70,7 @@
typedef void weakref_type;
private:
- mutable int32_t mCount;
+ mutable std::atomic<int32_t> mCount;
uint32_t* mBase;
size_t mSize;
};
diff --git a/libpixelflinger/tests/arch-arm64/assembler/arm64_assembler_test.cpp b/libpixelflinger/tests/arch-arm64/assembler/arm64_assembler_test.cpp
index 5f58797..63642c4 100644
--- a/libpixelflinger/tests/arch-arm64/assembler/arm64_assembler_test.cpp
+++ b/libpixelflinger/tests/arch-arm64/assembler/arm64_assembler_test.cpp
@@ -34,7 +34,6 @@
#include <sys/mman.h>
#include <cutils/ashmem.h>
-#include <cutils/atomic.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
diff --git a/libpixelflinger/tests/arch-mips64/assembler/mips64_assembler_test.cpp b/libpixelflinger/tests/arch-mips64/assembler/mips64_assembler_test.cpp
index b680b60..e8c4626 100644
--- a/libpixelflinger/tests/arch-mips64/assembler/mips64_assembler_test.cpp
+++ b/libpixelflinger/tests/arch-mips64/assembler/mips64_assembler_test.cpp
@@ -34,7 +34,6 @@
#include <sys/mman.h>
#include <cutils/ashmem.h>
-#include <cutils/atomic.h>
#include <cutils/log.h>
#define __STDC_FORMAT_MACROS
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index a2d6fcc..af6e02c 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -819,8 +819,9 @@
// disk does not have enough space.
result = TEMP_FAILURE_RETRY(fallocate(fd, 0, current_offset, declared_length));
if (result == -1 && errno == ENOSPC) {
- ALOGW("Zip: unable to allocate space for file to %" PRId64 ": %s",
- static_cast<int64_t>(declared_length + current_offset), strerror(errno));
+ ALOGW("Zip: unable to allocate %" PRId64 " bytes at offset %" PRId64 " : %s",
+ static_cast<int64_t>(declared_length), static_cast<int64_t>(current_offset),
+ strerror(errno));
return std::unique_ptr<FileWriter>(nullptr);
}
}