Panda3D
 All Classes Functions Variables Enumerations
memory.cxx
1 /*
2  * Memory allocator for TinyGL
3  */
4 #include "zgl.h"
5 #include "memoryHook.h"
6 
7 /* modify these functions so that they suit your needs */
8 
9 void gl_free(void *p)
10 {
11  PANDA_FREE_ARRAY(p);
12 }
13 
14 void *gl_malloc(int size)
15 {
16  return PANDA_MALLOC_ARRAY(size);
17 }
18 
19 void *gl_zalloc(int size)
20 {
21  void *buffer = PANDA_MALLOC_ARRAY(size);
22  memset(buffer, 0, size);
23  return buffer;
24 }