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

Commit 8a767feb authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Hardcode EGL Cache size to something more reasonable"

parents 5e86147a bace39e1
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -42,18 +42,6 @@ LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS += -fvisibility=hidden

ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
  LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
endif

ifneq ($(MAX_EGL_CACHE_KEY_SIZE),)
  LOCAL_CFLAGS += -DMAX_EGL_CACHE_KEY_SIZE=$(MAX_EGL_CACHE_KEY_SIZE)
endif

ifneq ($(MAX_EGL_CACHE_SIZE),)
  LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
endif

ifneq ($(filter address,$(SANITIZE_TARGET)),)
  LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\"
  LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\"
+3 −15
Original line number Diff line number Diff line
@@ -27,22 +27,10 @@
#include <sys/types.h>
#include <unistd.h>

#ifndef MAX_EGL_CACHE_ENTRY_SIZE
#define MAX_EGL_CACHE_ENTRY_SIZE (16 * 1024);
#endif

#ifndef MAX_EGL_CACHE_KEY_SIZE
#define MAX_EGL_CACHE_KEY_SIZE (1024);
#endif

#ifndef MAX_EGL_CACHE_SIZE
#define MAX_EGL_CACHE_SIZE (64 * 1024);
#endif

// Cache size limits.
static const size_t maxKeySize = MAX_EGL_CACHE_KEY_SIZE;
static const size_t maxValueSize = MAX_EGL_CACHE_ENTRY_SIZE;
static const size_t maxTotalSize = MAX_EGL_CACHE_SIZE;
static const size_t maxKeySize = 12 * 1024;
static const size_t maxValueSize = 64 * 1024;
static const size_t maxTotalSize = 2 * 1024 * 1024;

// Cache file header
static const char* cacheFileMagic = "EGL$";