Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ab4c47b authored by Lajos Molnar's avatar Lajos Molnar Committed by android-build-merger
Browse files

Merge "MemoryDealer: expose internal allocation alignment" into nyc-dev am: d6c017de

am: 37958360

* commit '37958360':
  MemoryDealer: expose internal allocation alignment
parents c5624d8c 37958360
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ public:
    virtual void        deallocate(size_t offset);
    virtual void        dump(const char* what) const;

    // allocations are aligned to some value. return that value so clients can account for it.
    static size_t      getAllocationAlignment();

    sp<IMemoryHeap> getMemoryHeap() const { return heap(); }

protected:
+8 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ public:
    void        dump(const char* what) const;
    void        dump(String8& res, const char* what) const;

    static size_t getAllocationAlignment() { return kMemoryAlign; }

private:

    struct chunk_t {
@@ -264,6 +266,12 @@ SimpleBestFitAllocator* MemoryDealer::allocator() const {
    return mAllocator;
}

// static
size_t MemoryDealer::getAllocationAlignment()
{
    return SimpleBestFitAllocator::getAllocationAlignment();
}

// ----------------------------------------------------------------------------

// align all the memory blocks on a cache-line boundary