svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22701:22704
[blender.git] / intern / memutil / MEM_CacheLimiter.h
index cada06ae523f9c673d11610292d2d5c6662fa0ec..43149efc977b3652d5e62e2572cc68460ba5cd80 100644 (file)
@@ -61,11 +61,8 @@ class MEM_CacheLimiter;
 
 #ifndef __MEM_cache_limiter_c_api_h_included__
 extern "C" {
-       extern void MEM_CacheLimiter_set_maximum(int m);
-       extern int MEM_CacheLimiter_get_maximum();
-        // this is rather _ugly_!
-        extern int mem_in_use;
-       extern int mmap_in_use;
+       extern void MEM_CacheLimiter_set_maximum(intptr_t m);
+       extern intptr_t MEM_CacheLimiter_get_maximum();
 };
 #endif
 
@@ -141,7 +138,10 @@ public:
                delete handle;
        }
        void enforce_limits() {
-               int max = MEM_CacheLimiter_get_maximum();
+               intptr_t max = MEM_CacheLimiter_get_maximum();
+               intptr_t mem_in_use= MEM_get_memory_in_use();
+               intptr_t mmap_in_use= MEM_get_mapped_memory_in_use();
+
                if (max == 0) {
                        return;
                }