diff options
Diffstat (limited to 'intern/memutil')
-rw-r--r-- | intern/memutil/MEM_Allocator.h | 1 | ||||
-rw-r--r-- | intern/memutil/MEM_CacheLimiter.h | 12 | ||||
-rw-r--r-- | intern/memutil/intern/MEM_CacheLimiterC-Api.cpp | 8 | ||||
-rw-r--r-- | intern/memutil/make/msvc_9_0/memutil.vcproj | 385 |
4 files changed, 396 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(); } diff --git a/intern/memutil/make/msvc_9_0/memutil.vcproj b/intern/memutil/make/msvc_9_0/memutil.vcproj new file mode 100644 index 00000000000..6f642fb16bc --- /dev/null +++ b/intern/memutil/make/msvc_9_0/memutil.vcproj @@ -0,0 +1,385 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="INT_memutil"
+ ProjectGUID="{E86B7BDE-C33C-4E55-9433-E74C141D7538}"
+ RootNamespace="memutil"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\memutil\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\memutil\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\intern;..\..\..\memutil"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\memutil\debug\memutil.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\memutil\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\memutil\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\memutil\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\debug\memutil.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying MEM files library (debug target) to lib tree."
+ CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\memutil\include MKDIR ..\..\..\..\..\build\msvc_9\intern\memutil\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\memutil\include
ECHO Done
"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\memutil"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\memutil"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="..\..\..\..\intern;..\..\..\memutil"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\memutil\memutil.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\memutil\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\memutil\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\memutil\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\memutil.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying MEM files library to lib tree."
+ CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\memutil\include MKDIR ..\..\..\..\..\build\msvc_9\intern\memutil\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\memutil\include
ECHO Done
"
+ />
+ </Configuration>
+ <Configuration
+ Name="3DPlugin Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="..\..\..\..\intern;..\..\..\memutil"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\memutil.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\memutil.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying MEM files library to lib tree."
+ CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\memutil\include MKDIR ..\..\..\..\..\build\msvc_9\intern\memutil\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\memutil\include
ECHO Done
"
+ />
+ </Configuration>
+ <Configuration
+ Name="3DPlugin Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\intern;..\..\..\memutil"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\debug\memutil.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\memutil\mtdll\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\memutil.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying MEM files library (debug target) to lib tree."
+ CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\memutil\include MKDIR ..\..\..\..\..\build\msvc_9\intern\memutil\include
XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\memutil\include
ECHO Done
"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\intern\MEM_CacheLimiterC-Api.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\MEM_RefCountedC-Api.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\MEM_Allocator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\MEM_CacheLimiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\MEM_CacheLimiterC-Api.h"
+ >
+ </File>
+ <Filter
+ Name="extern"
+ >
+ <File
+ RelativePath="..\..\MEM_NonCopyable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\MEM_RefCounted.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\MEM_RefCountedC-Api.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\MEM_RefCountPtr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\MEM_SmartPtr.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
|