Branimir Karadžić 8 years ago
parent
commit
6a6c5e3af9

+ 1 - 3
examples/common/debugdraw/debugdraw.cpp

@@ -380,13 +380,11 @@ struct DebugDraw
 		m_allocator = _allocator;
 		m_depthTestLess = _depthTestLess;
 
-#if BX_CONFIG_ALLOCATOR_CRT
 		if (NULL == _allocator)
 		{
-			static bx::CrtAllocator allocator;
+			static bx::DefaultAllocator allocator;
 			m_allocator = &allocator;
 		}
-#endif // BX_CONFIG_ALLOCATOR_CRT
 
 		DebugVertex::init();
 		DebugUvVertex::init();

+ 1 - 1
examples/common/entry/entry.cpp

@@ -95,7 +95,7 @@ namespace entry
 BX_PRAGMA_DIAGNOSTIC_PUSH();
 BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4459); // warning C4459: declaration of 's_allocator' hides global declaration
 BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow");
-		static bx::CrtAllocator s_allocator;
+		static bx::DefaultAllocator s_allocator;
 		return &s_allocator;
 BX_PRAGMA_DIAGNOSTIC_POP();
 	}

+ 1 - 3
examples/common/imgui/imgui.cpp

@@ -493,13 +493,11 @@ struct Imgui
 	{
 		m_allocator = _allocator;
 
-#if BX_CONFIG_ALLOCATOR_CRT
 		if (NULL == _allocator)
 		{
-			static bx::CrtAllocator allocator;
+			static bx::DefaultAllocator allocator;
 			m_allocator = &allocator;
 		}
-#endif // BX_CONFIG_ALLOCATOR_CRT
 
 		IMGUI_create(_fontSize, m_allocator);
 

+ 1 - 6
examples/common/nanovg/nanovg_bgfx.cpp

@@ -1093,13 +1093,8 @@ NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId, bx::AllocatorI* _alloca
 {
 	if (NULL == _allocator)
 	{
-#if BX_CONFIG_ALLOCATOR_CRT
-		static bx::CrtAllocator allocator;
+		static bx::DefaultAllocator allocator;
 		_allocator = &allocator;
-#else
-		BX_CHECK(false, "No allocator has been passed to nvgCreate(). Either specify a bx::AllocatorI instance or enable BX_CONFIG_ALLOCATOR_CRT directive.");
-		return NULL;
-#endif // BX_CONFIG_ALLOCATOR_CRT
 	}
 
 	struct NVGparams params;

+ 1 - 3
examples/common/ps/particle_system.cpp

@@ -494,13 +494,11 @@ namespace ps
 		{
 			m_allocator = _allocator;
 
-#if BX_CONFIG_ALLOCATOR_CRT
 			if (NULL == _allocator)
 			{
-				static bx::CrtAllocator allocator;
+				static bx::DefaultAllocator allocator;
 				m_allocator = &allocator;
 			}
-#endif // BX_CONFIG_ALLOCATOR_CRT
 
 			m_emitterAlloc = bx::createHandleAlloc(m_allocator, _maxEmitters);
 			m_emitter = (Emitter*)BX_ALLOC(m_allocator, sizeof(Emitter)*_maxEmitters);

+ 3 - 3
src/bgfx.cpp

@@ -2596,7 +2596,7 @@ namespace bgfx
 		}
 		else
 		{
-			bx::CrtAllocator allocator;
+			bx::DefaultAllocator allocator;
 			g_allocator =
 				s_allocatorStub = BX_NEW(&allocator, AllocatorStub);
 		}
@@ -2676,7 +2676,7 @@ error:
 
 			if (NULL != s_allocatorStub)
 			{
-				bx::CrtAllocator allocator;
+				bx::DefaultAllocator allocator;
 				BX_DELETE(&allocator, s_allocatorStub);
 				s_allocatorStub = NULL;
 			}
@@ -2716,7 +2716,7 @@ error:
 
 		if (NULL != s_allocatorStub)
 		{
-			bx::CrtAllocator allocator;
+			bx::DefaultAllocator allocator;
 			BX_DELETE(&allocator, s_allocatorStub);
 			s_allocatorStub = NULL;
 		}

+ 1 - 1
tools/geometryc/geometryc.cpp

@@ -865,7 +865,7 @@ int main(int _argc, const char* _argv[])
 	uint32_t positionOffset = decl.getOffset(bgfx::Attrib::Position);
 	uint32_t color0Offset   = decl.getOffset(bgfx::Attrib::Color0);
 
-	bx::CrtAllocator crtAllocator;
+	bx::DefaultAllocator crtAllocator;
 	bx::MemoryBlock  memBlock(&crtAllocator);
 
 	uint32_t ii = 0;

+ 1 - 1
tools/shaderc/shaderc_spirv.cpp

@@ -17,7 +17,7 @@ BX_PRAGMA_DIAGNOSTIC_POP()
 
 namespace bgfx
 {
-	static bx::CrtAllocator s_allocator;
+	static bx::DefaultAllocator s_allocator;
 	bx::AllocatorI* g_allocator = &s_allocator;
 
 	struct TinyStlAllocator