From dec03774b776343df20a85090f9ee916e0fc7b02 Mon Sep 17 00:00:00 2001 From: Matthew Endsley Date: Fri, 29 Jun 2012 19:58:40 -0700 Subject: [PATCH] updating tinystl allocator usage --- src/bgfx.cpp | 4 ++-- src/bgfx_p.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index d1b0d436f..e39873314 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -12,12 +12,12 @@ HWND g_bgfxHwnd = NULL; #if BGFX_CONFIG_USE_TINYSTL namespace tinystl { - void* allocator::static_allocate(size_t _bytes) + void* bgfx_allocator::static_allocate(size_t _bytes) { return bgfx::g_realloc(NULL, _bytes); } - void allocator::static_deallocate(void* _ptr, size_t /*_bytes*/) + void bgfx_allocator::static_deallocate(void* _ptr, size_t /*_bytes*/) { bgfx::g_free(_ptr); } diff --git a/src/bgfx_p.h b/src/bgfx_p.h index c8212b055..4a3fb8922 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -79,15 +79,16 @@ extern HWND g_bgfxHwnd; #define BGFX_MAGIC MAKEFOURCC('B','G','F','X') #if BGFX_CONFIG_USE_TINYSTL + namespace tinystl { - struct allocator + struct bgfx_allocator { static void* static_allocate(size_t _bytes); static void static_deallocate(void* _ptr, size_t /*_bytes*/); }; } // namespace tinystl -# define TINYSTL_ALLOCATOR_H +# define TINYSTL_ALLOCATOR tinystl::bgfx_allocator # include # include