Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/memutil')
-rw-r--r--intern/memutil/MEM_Allocator.h1
-rw-r--r--intern/memutil/MEM_CacheLimiter.h12
-rw-r--r--intern/memutil/intern/MEM_CacheLimiterC-Api.cpp8
3 files changed, 11 insertions, 10 deletions
diff --git a/intern/memutil/MEM_Allocator.h b/intern/memutil/MEM_Allocator.h
index d5ae94cc6b8..b2c3c5e82e2 100644
--- a/intern/memutil/MEM_Allocator.h
+++ b/intern/memutil/MEM_Allocator.h
@@ -25,6 +25,7 @@
#define __MEM_Allocator_h_included__ 1
#include "guardedalloc/MEM_guardedalloc.h"
+#include "guardedalloc/BLO_sys_types.h"
#ifdef _MSC_VER
#if _MSC_VER < 1300 // 1200 == VC++ 6.0 according to boost
diff --git a/intern/memutil/MEM_CacheLimiter.h b/intern/memutil/MEM_CacheLimiter.h
index cada06ae523..43149efc977 100644
--- a/intern/memutil/MEM_CacheLimiter.h
+++ b/intern/memutil/MEM_CacheLimiter.h
@@ -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;
}
diff --git a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
index 4cf0ef305d4..d998c9a3e80 100644
--- a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
+++ b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
@@ -27,18 +27,18 @@
#include "MEM_CacheLimiter.h"
#include "MEM_CacheLimiterC-Api.h"
-static int & get_max()
+static intptr_t & get_max()
{
- static int m = 32*1024*1024;
+ static intptr_t m = 32*1024*1024;
return m;
}
-void MEM_CacheLimiter_set_maximum(int m)
+void MEM_CacheLimiter_set_maximum(intptr_t m)
{
get_max() = m;
}
-int MEM_CacheLimiter_get_maximum()
+intptr_t MEM_CacheLimiter_get_maximum()
{
return get_max();
}