mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
proper mem accounting
This commit is contained in:
parent
1595033587
commit
4187bbd8bf
@ -2,20 +2,23 @@
|
|||||||
* Memory allocator for TinyGL
|
* Memory allocator for TinyGL
|
||||||
*/
|
*/
|
||||||
#include "zgl.h"
|
#include "zgl.h"
|
||||||
|
#include "memoryHook.h"
|
||||||
|
|
||||||
/* modify these functions so that they suit your needs */
|
/* modify these functions so that they suit your needs */
|
||||||
|
|
||||||
void gl_free(void *p)
|
void gl_free(void *p)
|
||||||
{
|
{
|
||||||
free(p);
|
PANDA_FREE_ARRAY(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *gl_malloc(int size)
|
void *gl_malloc(int size)
|
||||||
{
|
{
|
||||||
return malloc(size);
|
return PANDA_MALLOC_ARRAY(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *gl_zalloc(int size)
|
void *gl_zalloc(int size)
|
||||||
{
|
{
|
||||||
return calloc(1, size);
|
void *buffer = PANDA_MALLOC_ARRAY(size);
|
||||||
|
memset(buffer, 0, size);
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user