Slight tweaks (non-final) to get deallocate working properly in Qt UI

This commit is contained in:
baldurk
2015-07-10 16:38:20 +02:00
parent 42c6013058
commit 4c6a77d5d8
2 changed files with 11 additions and 5 deletions
+4
View File
@@ -62,7 +62,11 @@ struct array
elems = 0; count = 0;
}
#ifdef RENDERDOC_EXPORTS
static void deallocate(const void *p) { free((void *)p); }
#else
static void deallocate(const void *p) { RENDERDOC_FreeArrayMem(p); }
#endif
static void *allocate(size_t s) { return malloc(s); }
T &operator [](size_t i) { return elems[i]; }
+7 -5
View File
@@ -30,8 +30,6 @@
typedef uint8_t byte;
typedef uint32_t bool32;
#include "basic_types.h"
#ifdef WIN32
#ifdef RENDERDOC_EXPORTS
@@ -57,6 +55,13 @@ typedef uint32_t bool32;
#endif
// needs to be declared up here for reference in basic_types
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_FreeArrayMem(const void *mem);
typedef void (RENDERDOC_CC *pRENDERDOC_FreeArrayMem)(const void *mem);
#include "basic_types.h"
// We give every resource a globally unique ID so that we can differentiate
// between two textures allocated in the same memory (after the first is freed)
//
@@ -296,6 +301,3 @@ typedef void (RENDERDOC_CC *pRENDERDOC_LogText)(const char *text);
extern "C" RENDERDOC_API bool32 RENDERDOC_CC RENDERDOC_GetThumbnail(const char *filename, byte *buf, uint32_t &len);
typedef bool32 (RENDERDOC_CC *pRENDERDOC_GetThumbnail)(const char *filename, byte *buf, uint32_t &len);
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_FreeArrayMem(const void *mem);
typedef void (RENDERDOC_CC *pRENDERDOC_FreeArrayMem)(const void *mem);