This commit is contained in:
Branimir Karadžić 2017-06-10 22:31:59 -07:00
parent b6ccccd4c5
commit 6a6c5e3af9
8 changed files with 10 additions and 21 deletions

View File

@ -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();

View File

@ -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();
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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