Browse Source

Using the ReuseMemory flag to enable allocator.cpp, having it disabled by default for stability.

David Piuva 3 years ago
parent
commit
e49f986ee3

+ 8 - 0
Source/DFPSR/DFPSR.DsrHead

@@ -5,9 +5,17 @@
 #   Systems:
 #   Systems:
 #     * Give the Linux flag when compiling on Linux or similar Posix systems having the same dependencies installed.
 #     * Give the Linux flag when compiling on Linux or similar Posix systems having the same dependencies installed.
 #     * Give the Windows flag when compiling on Microsoft Windows.
 #     * Give the Windows flag when compiling on Microsoft Windows.
+#   Features:
+#     * Give the ReuseMemory flag to enable memory recycling using allocator.cpp.
+#       This can cause crashes if you have more than one memory recycler linked,
+#       because you don't want one implementation allocating and another freeing.
 #   Strings use a subset of the C standard for mangling, so \\ is used to write \.
 #   Strings use a subset of the C standard for mangling, so \\ is used to write \.
 #     You can also use / and let the file abstraction layer convert it into \ automatically when running on Windows.
 #     You can also use / and let the file abstraction layer convert it into \ automatically when running on Windows.
 
 
+if ReuseMemory
+	Crawl "base/allocator.cpp"
+end if
+
 if Linux
 if Linux
 	Message "Building for Linux\n"
 	Message "Building for Linux\n"
 end if
 end if

+ 1 - 0
Source/SDK/cube/Cube.DsrProj

@@ -1,4 +1,5 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+ReuseMemory
 Graphics
 Graphics
 #Sound
 #Sound
 Crawl "main.cpp"
 Crawl "main.cpp"

+ 1 - 0
Source/SDK/guiExample/GuiExample.DsrProj

@@ -1,4 +1,5 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+ReuseMemory
 Graphics
 Graphics
 #Sound
 #Sound
 Crawl "main.cpp"
 Crawl "main.cpp"

+ 1 - 0
Source/SDK/sandbox/Sandbox.DsrProj

@@ -1,4 +1,5 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+ReuseMemory
 Graphics
 Graphics
 #Sound
 #Sound
 
 

+ 1 - 0
Source/SDK/terrain/Terrain.DsrProj

@@ -1,4 +1,5 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+ReuseMemory
 Graphics
 Graphics
 #Sound
 #Sound
 Crawl "main.cpp"
 Crawl "main.cpp"

+ 1 - 0
Source/templates/basic3D/Basic3D.DsrProj

@@ -1,4 +1,5 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+ReuseMemory
 Graphics
 Graphics
 Sound
 Sound
 Crawl "main.cpp"
 Crawl "main.cpp"

+ 1 - 0
Source/templates/basicGUI/BasicGUI.DsrProj

@@ -1,4 +1,5 @@
 CompilerFlag "-std=c++14"
 CompilerFlag "-std=c++14"
+ReuseMemory
 Graphics
 Graphics
 Sound
 Sound
 Crawl "main.cpp"
 Crawl "main.cpp"

+ 0 - 2
Source/tools/builder/main.cpp

@@ -12,8 +12,6 @@
 //      Import "../../DFPSR/DFPSR.DsrHead"
 //      Import "../../DFPSR/DFPSR.DsrHead"
 //  * Call the compiler directly when the temp folder is given without any script name.
 //  * Call the compiler directly when the temp folder is given without any script name.
 //    Use it to run multiple instances of the compiler at the same time on different CPU cores.
 //    Use it to run multiple instances of the compiler at the same time on different CPU cores.
-//  * Add a ReuseMemory flag for enabling Allocator.cpp.
-//    The macro for supressing it will then no longer be needed when using the new build system.
 //  * Improve entropy in checksums using a more advanced algorithm to reduce the risk of conflicts.
 //  * Improve entropy in checksums using a more advanced algorithm to reduce the risk of conflicts.
 //  * Implement more features for the machine, such as:
 //  * Implement more features for the machine, such as:
 //    * else and elseif cases.
 //    * else and elseif cases.