|
@@ -32,8 +32,8 @@
|
|
#define SPINE_EXTENSION_H_
|
|
#define SPINE_EXTENSION_H_
|
|
|
|
|
|
/* All allocation uses these. */
|
|
/* All allocation uses these. */
|
|
-#define MALLOC(TYPE,COUNT) ((TYPE*)_malloc(sizeof(TYPE) * COUNT))
|
|
|
|
-#define CALLOC(TYPE,COUNT) ((TYPE*)_calloc(COUNT, sizeof(TYPE)))
|
|
|
|
|
|
+#define MALLOC(TYPE,COUNT) ((TYPE*)_malloc(sizeof(TYPE) * COUNT, __FILE__, __LINE__))
|
|
|
|
+#define CALLOC(TYPE,COUNT) ((TYPE*)_calloc(COUNT, sizeof(TYPE), __FILE__, __LINE__))
|
|
#define NEW(TYPE) CALLOC(TYPE,1)
|
|
#define NEW(TYPE) CALLOC(TYPE,1)
|
|
|
|
|
|
/* Gets the direct super class. Type safe. */
|
|
/* Gets the direct super class. Type safe. */
|
|
@@ -97,11 +97,12 @@ char* _spUtil_readFile (const char* path, int* length);
|
|
* Internal API available for extension:
|
|
* Internal API available for extension:
|
|
*/
|
|
*/
|
|
|
|
|
|
-void* _malloc (size_t size);
|
|
|
|
-void* _calloc (size_t num, size_t size);
|
|
|
|
|
|
+void* _malloc (size_t size, const char* file, int line);
|
|
|
|
+void* _calloc (size_t num, size_t size, const char* file, int line);
|
|
void _free (void* ptr);
|
|
void _free (void* ptr);
|
|
|
|
|
|
void _setMalloc (void* (*_malloc) (size_t size));
|
|
void _setMalloc (void* (*_malloc) (size_t size));
|
|
|
|
+void _setDebugMalloc (void* (*_malloc) (size_t size, const char* file, int line));
|
|
void _setFree (void (*_free) (void* ptr));
|
|
void _setFree (void (*_free) (void* ptr));
|
|
|
|
|
|
char* _readFile (const char* path, int* length);
|
|
char* _readFile (const char* path, int* length);
|