[PD-cvs] pd/src m_memory.c,1.2.4.1,1.2.4.1.2.1
Tim Blechmann
timblech at users.sourceforge.net
Sun Sep 11 13:51:48 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8638
Modified Files:
Tag: devel_0_39
m_memory.c
Log Message:
removing debug messages to make functions threadsafe
Index: m_memory.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_memory.c,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.1.2.1
diff -C2 -d -r1.2.4.1 -r1.2.4.1.2.1
*** m_memory.c 5 Nov 2004 13:57:56 -0000 1.2.4.1
--- m_memory.c 11 Sep 2005 11:51:46 -0000 1.2.4.1.2.1
***************
*** 19,33 ****
#endif
-
- /* #define LOUD */
- #ifdef LOUD
- #include <stdio.h>
- #endif
-
- /* #define DEBUGMEM */
- #ifdef DEBUGMEM
- static int totalmem = 0;
- #endif
-
void *getbytes(size_t nbytes)
{
--- 19,22 ----
***************
*** 35,44 ****
if (nbytes < 1) nbytes = 1;
ret = (void *)calloc(nbytes, 1);
- #ifdef LOUD
- fprintf(stderr, "new %lx %d\n", (int)ret, nbytes);
- #endif /* LOUD */
- #ifdef DEBUGMEM
- totalmem += nbytes;
- #endif
if (!ret)
post("pd: getbytes() failed -- out of memory");
--- 24,27 ----
***************
*** 68,77 ****
if (newsize > oldsize && ret)
memset(((char *)ret) + oldsize, 0, newsize - oldsize);
- #ifdef LOUD
- fprintf(stderr, "resize %lx %d --> %lx %d\n", (int)old, oldsize, (int)ret, newsize);
- #endif /* LOUD */
- #ifdef DEBUGMEM
- totalmem += (newsize - oldsize);
- #endif
if (!ret)
post("pd: resizebytes() failed -- out of memory");
--- 51,54 ----
***************
*** 81,92 ****
void freebytes(void *fatso, size_t nbytes)
{
- if (nbytes == 0)
- nbytes = 1;
- #ifdef LOUD
- fprintf(stderr, "free %lx %d\n", (int)fatso, nbytes);
- #endif /* LOUD */
- #ifdef DEBUGMEM
- totalmem -= nbytes;
- #endif
free(fatso);
}
--- 58,61 ----
***************
*** 102,109 ****
void *vec = getbytes(nbytes+ (VECTORALIGNMENT/8-1)+sizeof(void *));
- #ifdef LOUD
- fprintf(stderr, "getaligned %p %d\n",vec, nbytes);
- #endif /* LOUD */
-
if (vec != NULL)
{
--- 71,74 ----
***************
*** 127,133 ****
void *ori = *(void **)((unsigned char *)ptr-sizeof(void *));
- #ifdef LOUD
- fprintf(stderr, "freealigned %p %p %d\n",ptr, ori, nbytes);
- #endif /* LOUD */
freebytes(ori,nbytes+(VECTORALIGNMENT/8-1)+sizeof(void *));
}
--- 92,95 ----
***************
*** 159,169 ****
return (ret);
}
-
- #ifdef DEBUGMEM
- #include <stdio.h>
-
- void glob_foo(void *dummy, t_symbol *s, int argc, t_atom *argv)
- {
- fprintf(stderr, "total mem %d\n", totalmem);
- }
- #endif
--- 121,122 ----
More information about the Pd-cvs
mailing list