mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[c] Fixed KMemory and test harness for GCC on Linux.
This commit is contained in:
parent
5cd07084b0
commit
3dbab2122d
@ -22,11 +22,11 @@ void RegisterMemoryLeakDetector()
|
||||
{
|
||||
// Register our malloc and free functions to track memory leaks
|
||||
#ifdef KANJI_MEMTRACE
|
||||
_setDebugMalloc(_kanjimalloc);
|
||||
_spSetDebugMalloc(_kanjimalloc);
|
||||
#endif
|
||||
_setMalloc(_kanjimalloc);
|
||||
_setRealloc(_kanjirealloc);
|
||||
_setFree(_kanjifree);
|
||||
_spSetMalloc(_kanjimalloc);
|
||||
_spSetRealloc(_kanjirealloc);
|
||||
_spSetFree(_kanjifree);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
@ -74,6 +74,6 @@ extern "C" { // probably unnecessary
|
||||
}
|
||||
|
||||
char* _spUtil_readFile(const char* path, int* length) {
|
||||
return _readFile(path, length);
|
||||
return _spReadFile(path, length);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Our memory system is thread-safe, but instead of linking massive libraries,
|
||||
// we attempt to use C++11 std::mutex.
|
||||
#ifdef USE_CPP11_MUTEX
|
||||
#ifdef USE_CPP11_MUTEX_DISABLED
|
||||
#include <mutex>
|
||||
typedef std::recursive_mutex KSysLock; // rentrant
|
||||
struct KAutoLock {
|
||||
@ -300,4 +300,4 @@ size_t KMemoryAllocated()
|
||||
size += info.size;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user