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

Commit 4a333f32 authored by Juan Yescas's avatar Juan Yescas Committed by Automerger Merge Worker
Browse files

Merge "libvulkan: Remove use of hardcoded PAGE_SIZE 4096" into main am:...

Merge "libvulkan: Remove use of hardcoded PAGE_SIZE 4096" into main am: 8433f63b am: c9a2145f am: 4d7fbe86

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2701953



Change-Id: Icc1684fdbc5ffb7a6c7aef71c9a39b6aa3b9e854
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ded0bbe7 4d7fbe86
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <dlfcn.h>
#include <string.h>
#include <sys/prctl.h>
#include <unistd.h>

#include <mutex>
#include <string>
@@ -362,6 +363,7 @@ template <typename Functor>
void ForEachFileInZip(const std::string& zipname,
                      const std::string& dir_in_zip,
                      Functor functor) {
    static const size_t kPageSize = getpagesize();
    int32_t err;
    ZipArchiveHandle zip = nullptr;
    if ((err = OpenArchive(zipname.c_str(), &zip)) != 0) {
@@ -389,7 +391,7 @@ void ForEachFileInZip(const std::string& zipname,
        // the APK. Loading still may fail for other reasons, but this at least
        // lets us avoid failed-to-load log messages in the typical case of
        // compressed and/or unaligned libraries.
        if (entry.method != kCompressStored || entry.offset % PAGE_SIZE != 0)
        if (entry.method != kCompressStored || entry.offset % kPageSize != 0)
            continue;
        functor(filename);
    }