Allow creation of heaps that are read-only to partner

Change-Id: I3c2b3d9b1671da4b9d9c58dce27e291d30703b03
This commit is contained in:
Glenn Kasten 2014-03-14 16:49:51 -07:00
parent 75555b2eaf
commit 6546f2e458
2 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,8 @@ class SimpleBestFitAllocator;
class MemoryDealer : public RefBase
{
public:
MemoryDealer(size_t size, const char* name = 0);
MemoryDealer(size_t size, const char* name = 0,
uint32_t flags = 0 /* or bits such as MemoryHeapBase::READ_ONLY */ );
virtual sp<IMemory> allocate(size_t size);
virtual void deallocate(size_t offset);

View File

@ -225,8 +225,8 @@ Allocation::~Allocation()
// ----------------------------------------------------------------------------
MemoryDealer::MemoryDealer(size_t size, const char* name)
: mHeap(new MemoryHeapBase(size, 0, name)),
MemoryDealer::MemoryDealer(size_t size, const char* name, uint32_t flags)
: mHeap(new MemoryHeapBase(size, flags, name)),
mAllocator(new SimpleBestFitAllocator(size))
{
}