[gegl] gegl: use uint64_t for memory computations



commit 08084a6de9e6d4ee665addf3b0b8587f7f639420
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Jul 8 18:45:33 2019 +0200

    gegl: use uint64_t for memory computations
    
    This ensures we avoid overflow in case PAE lets 32bit builds know of more
    memory than a single process can acccess. See issue #176.

 gegl/gegl-config.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/gegl-config.c b/gegl/gegl-config.c
index 9f774514d..1b6fc25e8 100644
--- a/gegl/gegl-config.c
+++ b/gegl/gegl-config.c
@@ -230,10 +230,10 @@ gegl_config_class_init (GeglConfigClass *klass)
                                                      G_PARAM_READWRITE));
 
   {
-    long default_tile_cache_size = 1024l * 1024 * 1024;
-    long mem_total = default_tile_cache_size;
-    long mem_min = 512 << 20; // 512mb
-    long mem_available = mem_min;
+    uint64_t default_tile_cache_size = 1024l * 1024 * 1024;
+    uint64_t mem_total = default_tile_cache_size;
+    uint64_t mem_min = 512 << 20; // 512mb
+    uint64_t mem_available = mem_min;
 
 #ifdef G_OS_WIN32
 # if defined(_MSC_VER) && (_MSC_VER <= 1200)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]