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

Commit 37958360 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

* commit 'd6c017de':
  MemoryDealer: expose internal allocation alignment
parents 26f56490 d6c017de
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,9 @@ public:
    virtual void        deallocate(size_t offset);
    virtual void        deallocate(size_t offset);
    virtual void        dump(const char* what) const;
    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(); }
    sp<IMemoryHeap> getMemoryHeap() const { return heap(); }


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


    static size_t getAllocationAlignment() { return kMemoryAlign; }

private:
private:


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


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

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


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