ecore_evas: use portable infrastructure to detect page size.
authorCedric BAIL <cedric@efl.so>
Sun, 10 Nov 2013 08:26:44 +0000 (09:26 +0100)
committerCedric BAIL <cedric@efl.so>
Sun, 10 Nov 2013 08:26:44 +0000 (09:26 +0100)
src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c

index 39135a3..32b2e7b 100644 (file)
@@ -18,6 +18,9 @@ _extnbuf_new(const char *base, int id, Eina_Bool sys, int num,
    Extnbuf *b;
    char file[PATH_MAX];
    mode_t mode = S_IRUSR | S_IWUSR;
+   int page_size;
+
+   page_size = eina_cpu_page_size();
 
    b = calloc(1, sizeof(Extnbuf));
    b->fd = -1;
@@ -26,7 +29,7 @@ _extnbuf_new(const char *base, int id, Eina_Bool sys, int num,
    b->w = w;
    b->h = h;
    b->stride = w * 4;
-   b->size = 4096 * (((b->stride * b->h) + (4096 - 1)) / 4096);
+   b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size);
    b->am_owner = owner;
 
    snprintf(file, sizeof(file), "/%s-%i.%i", base, id, num);