diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/memutil/MEM_CacheLimiter.h | 14 | ||||
-rw-r--r-- | intern/memutil/MEM_CacheLimiterC-Api.h | 4 | ||||
-rw-r--r-- | intern/memutil/intern/MEM_CacheLimiterC-Api.cpp | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/intern/memutil/MEM_CacheLimiter.h b/intern/memutil/MEM_CacheLimiter.h index fc12f22cfe6..94aca280a0e 100644 --- a/intern/memutil/MEM_CacheLimiter.h +++ b/intern/memutil/MEM_CacheLimiter.h @@ -65,8 +65,8 @@ class MEM_CacheLimiter; #ifndef __MEM_cache_limiter_c_api_h_included__ extern "C" { - extern void MEM_CacheLimiter_set_maximum(intptr_t m); - extern intptr_t MEM_CacheLimiter_get_maximum(); + extern void MEM_CacheLimiter_set_maximum(size_t m); + extern size_t MEM_CacheLimiter_get_maximum(); }; #endif @@ -125,7 +125,7 @@ class MEM_CacheLimiter { public: typedef typename std::list<MEM_CacheLimiterHandle<T> *, MEM_Allocator<MEM_CacheLimiterHandle<T> *> >::iterator iterator; - typedef intptr_t (*MEM_CacheLimiter_DataSize_Func) (void *data); + typedef size_t (*MEM_CacheLimiter_DataSize_Func) (void *data); MEM_CacheLimiter(MEM_CacheLimiter_DataSize_Func getDataSize_) : getDataSize(getDataSize_) { } @@ -146,8 +146,8 @@ public: delete handle; } void enforce_limits() { - intptr_t max = MEM_CacheLimiter_get_maximum(); - intptr_t mem_in_use, cur_size; + size_t max = MEM_CacheLimiter_get_maximum(); + size_t mem_in_use, cur_size; if (max == 0) { return; @@ -188,8 +188,8 @@ public: handle->me = it; } private: - intptr_t total_size() { - intptr_t size = 0; + size_t total_size() { + size_t size = 0; for (iterator it = queue.begin(); it != queue.end(); it++) { size+= getDataSize((*it)->get()->get_data()); } diff --git a/intern/memutil/MEM_CacheLimiterC-Api.h b/intern/memutil/MEM_CacheLimiterC-Api.h index 768842caee6..c8672fa03fd 100644 --- a/intern/memutil/MEM_CacheLimiterC-Api.h +++ b/intern/memutil/MEM_CacheLimiterC-Api.h @@ -42,10 +42,10 @@ typedef struct MEM_CacheLimiterHandle_s MEM_CacheLimiterHandleC; typedef void(*MEM_CacheLimiter_Destruct_Func)(void*); /* function used to measure stored data element size */ -typedef intptr_t(*MEM_CacheLimiter_DataSize_Func) (void*); +typedef size_t(*MEM_CacheLimiter_DataSize_Func) (void*); #ifndef MEM_CACHELIMITER_H -extern void MEM_CacheLimiter_set_maximum(int m); +extern void MEM_CacheLimiter_set_maximum(size_t m); extern int MEM_CacheLimiter_get_maximum(void); #endif // MEM_CACHELIMITER_H /** diff --git a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp index 4fdbbf8f9d4..0ec1ccddb15 100644 --- a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp +++ b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp @@ -29,18 +29,18 @@ #include "MEM_CacheLimiter.h" #include "MEM_CacheLimiterC-Api.h" -static intptr_t & get_max() +static size_t & get_max() { - static intptr_t m = 32*1024*1024; + static size_t m = 32*1024*1024; return m; } -void MEM_CacheLimiter_set_maximum(intptr_t m) +void MEM_CacheLimiter_set_maximum(size_t m) { get_max() = m; } -intptr_t MEM_CacheLimiter_get_maximum() +size_t MEM_CacheLimiter_get_maximum() { return get_max(); } |