mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +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
|
// Register our malloc and free functions to track memory leaks
|
||||||
#ifdef KANJI_MEMTRACE
|
#ifdef KANJI_MEMTRACE
|
||||||
_setDebugMalloc(_kanjimalloc);
|
_spSetDebugMalloc(_kanjimalloc);
|
||||||
#endif
|
#endif
|
||||||
_setMalloc(_kanjimalloc);
|
_spSetMalloc(_kanjimalloc);
|
||||||
_setRealloc(_kanjirealloc);
|
_spSetRealloc(_kanjirealloc);
|
||||||
_setFree(_kanjifree);
|
_spSetFree(_kanjifree);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
@ -74,6 +74,6 @@ extern "C" { // probably unnecessary
|
|||||||
}
|
}
|
||||||
|
|
||||||
char* _spUtil_readFile(const char* path, int* length) {
|
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,
|
// Our memory system is thread-safe, but instead of linking massive libraries,
|
||||||
// we attempt to use C++11 std::mutex.
|
// we attempt to use C++11 std::mutex.
|
||||||
#ifdef USE_CPP11_MUTEX
|
#ifdef USE_CPP11_MUTEX_DISABLED
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
typedef std::recursive_mutex KSysLock; // rentrant
|
typedef std::recursive_mutex KSysLock; // rentrant
|
||||||
struct KAutoLock {
|
struct KAutoLock {
|
||||||
@ -300,4 +300,4 @@ size_t KMemoryAllocated()
|
|||||||
size += info.size;
|
size += info.size;
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user