Update of /cvsroot/pure-data/externals/grill/flext/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22773/source
Modified Files: flout.cpp flsupport.cpp flsupport.h Log Message: some minor changes after valgrind run fix uninitialized pointer With FLEXT_USECMEM normal C library memory allocation will be used, otherwise global operators will be overridden to use memory allocation by the real-time system (getbytes). more pthreads V2 fixes Deprecated FLEXT_NOGLOBALNEW in favor of FLEXT_USECMEM.
Index: flout.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flout.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** flout.cpp 19 Nov 2005 23:10:53 -0000 1.24 --- flout.cpp 10 Dec 2005 21:34:08 -0000 1.25 *************** *** 105,108 **** --- 105,109 ---- // if(xi.desc && *xi.desc) class_settip(thisClass(),gensym(xi.desc)); #endif + inlets[0] = NULL; }
Index: flsupport.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** flsupport.cpp 11 Oct 2005 22:22:48 -0000 1.54 --- flsupport.cpp 10 Dec 2005 21:34:08 -0000 1.55 *************** *** 105,108 **** --- 105,110 ---- #define LARGEALLOC 32000
+ #ifndef FLEXT_USECMEM + #ifdef FLEXT_DEBUGMEM static const size_t memtest = 0x12345678L; *************** *** 193,196 **** --- 195,200 ---- #endif
+ #endif + void *flext_root::NewAligned(size_t bytes,int bitalign) {
Index: flsupport.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.h,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** flsupport.h 6 Dec 2005 21:52:26 -0000 1.100 --- flsupport.h 10 Dec 2005 21:34:08 -0000 1.101 *************** *** 47,50 **** --- 47,64 ---- */
+ #ifdef FLEXT_NOGLOBALNEW + #error FLEXT_NOGLOBALNEW is deprecated, define FLEXT_USECMEM instead + #define FLEXT_USECMEM + #endif + + #ifdef FLEXT_USECMEM + inline void *operator new(size_t bytes) { return ::operator new(bytes); } + inline void operator delete(void *blk) { ::operator delete(blk); } + + inline void *operator new[](size_t bytes) { return ::operator new[](bytes); } + inline void operator delete[](void *blk) { ::operator delete[](blk); } + + static bool MemCheck(void *) { return true; } + #else /*! Overloaded new memory allocation method \note this uses a fast allocation method of the real-time system *************** *** 55,61 **** void operator delete(void *blk);
! #ifndef __BORLANDC__ ! inline void *operator new(size_t,void *p) { return p; } ! inline void operator delete(void *,void *) {} #endif
--- 69,75 ---- void operator delete(void *blk);
! #ifndef __MRC__ // doesn't allow new[] overloading?! ! inline void *operator new[](size_t bytes) { return operator new(bytes); } ! inline void operator delete[](void *blk) { operator delete(blk); } #endif
*************** *** 66,74 **** #endif
! #ifndef __MRC__ // doesn't allow new[] overloading?! ! inline void *operator new[](size_t bytes) { return operator new(bytes); } ! inline void operator delete[](void *blk) { operator delete(blk); }
#ifndef __BORLANDC__ inline void *operator new[](size_t,void *p) { return p; } inline void operator delete[](void *,void *) {} --- 80,89 ---- #endif
! #endif // USECMEM
#ifndef __BORLANDC__ + inline void *operator new(size_t,void *p) { return p; } + inline void operator delete(void *,void *) {} + #ifndef __MRC__ inline void *operator new[](size_t,void *p) { return p; } inline void operator delete[](void *,void *) {} *************** *** 90,94 **** };
! #ifndef FLEXT_NOGLOBALNEW /************************************************************************/ // MFC doesn't like global overloading of allocators --- 105,109 ---- };
! #ifndef FLEXT_USECMEM /************************************************************************/ // MFC doesn't like global overloading of allocators *************** *** 111,115 **** #endif
! #endif // FLEXT_NOGLOBALNEW
/************************************************************************/ --- 126,130 ---- #endif
! #endif // FLEXT_USECMEM
/************************************************************************/ *************** *** 793,798 **** #if FLEXT_THREADS == FLEXT_THR_POSIX return pthread_equal(ref,t) != 0; - #elif FLEXT_THREADS == FLEXT_THR_WIN32 - return ref == t; #else return ref == t; --- 808,811 ----