Branimir Karadžić 8 years ago
parent
commit
6d35b1294e
6 changed files with 13 additions and 30 deletions
  1. 0 4
      include/bx/config.h
  2. 5 14
      include/bx/crtimpl.h
  3. 5 9
      src/crtimpl.cpp
  4. 1 1
      tests/simd_bench.cpp
  5. 1 1
      tests/string_test.cpp
  6. 1 1
      tools/bin2c/bin2c.cpp

+ 0 - 4
include/bx/config.h

@@ -12,10 +12,6 @@
 #	define BX_CONFIG_ALLOCATOR_DEBUG 0
 #endif // BX_CONFIG_DEBUG_ALLOC
 
-#ifndef BX_CONFIG_ALLOCATOR_CRT
-#	define BX_CONFIG_ALLOCATOR_CRT 1
-#endif // BX_CONFIG_ALLOCATOR_CRT
-
 #ifndef BX_CONFIG_CRT_FILE_READER_WRITER
 #	define BX_CONFIG_CRT_FILE_READER_WRITER !(0 \
 			|| BX_CRT_NONE                      \

+ 5 - 14
include/bx/crtimpl.h

@@ -6,33 +6,24 @@
 #ifndef BX_CRTIMPL_H_HEADER_GUARD
 #define BX_CRTIMPL_H_HEADER_GUARD
 
-#include "bx.h"
-
-#if BX_CONFIG_ALLOCATOR_CRT
-#	include "allocator.h"
-#endif // BX_CONFIG_ALLOCATOR_CRT
-
-#if BX_CONFIG_CRT_FILE_READER_WRITER
-#	include "readerwriter.h"
-#endif // BX_CONFIG_CRT_FILE_READER_WRITER
+#include "allocator.h"
+#include "readerwriter.h"
 
 namespace bx
 {
-#if BX_CONFIG_ALLOCATOR_CRT
 	///
-	class CrtAllocator : public AllocatorI
+	class DefaultAllocator : public AllocatorI
 	{
 	public:
 		///
-		CrtAllocator();
+		DefaultAllocator();
 
 		///
-		virtual ~CrtAllocator();
+		virtual ~DefaultAllocator();
 
 		///
 		virtual void* realloc(void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line) BX_OVERRIDE;
 	};
-#endif // BX_CONFIG_ALLOCATOR_CRT
 
 #if BX_CONFIG_CRT_FILE_READER_WRITER
 	///

+ 5 - 9
src/crtimpl.cpp

@@ -4,24 +4,21 @@
  */
 
 #include <bx/crtimpl.h>
-#include <stdio.h>
 
-#if BX_CONFIG_ALLOCATOR_CRT
-#	include <malloc.h>
-#endif // BX_CONFIG_ALLOCATOR_CRT
+#include <stdio.h>
+#include <malloc.h>
 
 namespace bx
 {
-#if BX_CONFIG_ALLOCATOR_CRT
-	CrtAllocator::CrtAllocator()
+	DefaultAllocator::DefaultAllocator()
 	{
 	}
 
-	CrtAllocator::~CrtAllocator()
+	DefaultAllocator::~DefaultAllocator()
 	{
 	}
 
-	void* CrtAllocator::realloc(void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line)
+	void* DefaultAllocator::realloc(void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line)
 	{
 		if (0 == _size)
 		{
@@ -70,7 +67,6 @@ namespace bx
 		return bx::alignedRealloc(this, _ptr, _size, _align, _file, _line);
 #	endif // BX_
 	}
-#endif // BX_CONFIG_ALLOCATOR_CRT
 
 #if BX_CONFIG_CRT_FILE_READER_WRITER
 

+ 1 - 1
tests/simd_bench.cpp

@@ -98,7 +98,7 @@ void simd_bench_pass(bx::simd128_t* _dst, bx::simd128_t* _src, uint32_t _numVert
 
 void simd_bench()
 {
-	bx::CrtAllocator allocator;
+	bx::DefaultAllocator allocator;
 	bx::RngMwc rng;
 
 	const uint32_t numVertices = 1024*1024;

+ 1 - 1
tests/string_test.cpp

@@ -187,7 +187,7 @@ TEST_CASE("StringView", "")
 	bx::StringView sv("test");
 	REQUIRE(4 == sv.getLength() );
 
-	bx::CrtAllocator crt;
+	bx::DefaultAllocator crt;
 	g_allocator = &crt;
 
 	typedef bx::StringT<&g_allocator> String;

+ 1 - 1
tools/bin2c/bin2c.cpp

@@ -154,7 +154,7 @@ int main(int _argc, const char* _argv[])
 	{
 		size = uint32_t(bx::getSize(&fr) );
 
-		bx::CrtAllocator allocator;
+		bx::DefaultAllocator allocator;
 		data = BX_ALLOC(&allocator, size);
 		bx::read(&fr, data, size);