diff options
Diffstat (limited to 'externals')
-rw-r--r-- | externals/grill/fftease/fftease.vcproj | 52 | ||||
-rw-r--r-- | externals/grill/flext/changes.txt | 1 | ||||
-rw-r--r-- | externals/grill/flext/flext.vcproj | 20 | ||||
-rw-r--r-- | externals/grill/flext/source/flbuf.cpp | 4 | ||||
-rw-r--r-- | externals/grill/flext/source/fldsp.cpp | 2 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.cpp | 59 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 18 | ||||
-rw-r--r-- | externals/grill/guitest/flgui.cpp | 7 | ||||
-rw-r--r-- | externals/grill/py/config-pd-msvc.txt | 3 | ||||
-rw-r--r-- | externals/grill/py/source/main.cpp | 8 | ||||
-rw-r--r-- | externals/grill/py/source/main.h | 2 | ||||
-rw-r--r-- | externals/grill/py/source/pyext.cpp | 5 | ||||
-rw-r--r-- | externals/grill/xsample/xsample.vcproj | 2 |
13 files changed, 116 insertions, 67 deletions
diff --git a/externals/grill/fftease/fftease.vcproj b/externals/grill/fftease/fftease.vcproj index 49673705..18abd1d6 100644 --- a/externals/grill/fftease/fftease.vcproj +++ b/externals/grill/fftease/fftease.vcproj @@ -179,6 +179,7 @@ LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories=""F:\prog\audio\MaxWinSDK\c74support\msp-includes\win-includes\release";"F:\prog\audio\MaxWinSDK\c74support\max-includes\win-includes\release",f:\prog\max\flext\max-msvc" + IgnoreAllDefaultLibraries="TRUE" ProgramDatabaseFile="$(outdir)/fftease.pdb" ImportLibrary="$(outdir)/fftease.lib" TargetMachine="1"/> @@ -540,8 +541,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -576,8 +576,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -612,8 +611,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -648,8 +646,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -684,8 +681,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -720,8 +716,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -756,8 +751,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -792,8 +786,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -828,8 +821,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -864,8 +856,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -900,8 +891,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -936,8 +926,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -972,8 +961,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -1008,8 +996,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -1044,8 +1031,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -3306,8 +3292,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> @@ -3342,8 +3327,7 @@ <Tool Name="VCCLCompilerTool" Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FLEXT_SYS=2;$(NoInherit)"/> + AdditionalIncludeDirectories=""/> </FileConfiguration> <FileConfiguration Name="Max Debug|Win32"> diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt index ed9aaa44..84ebac86 100644 --- a/externals/grill/flext/changes.txt +++ b/externals/grill/flext/changes.txt @@ -30,7 +30,6 @@ Version history: - ListAttributes (or the getattributes message) now lists attributes in the order they were created (first class, then object scope) - enforcing usage of STL - explicit boolean attributes (great for attribute editor layout!) -- added flext::NewLarge and flext::FreeLarge memory allocation functions which use the C-Library heap and should mainly be used in secondary threads - flext_dsp reported wrong inlet/outlet count (CntInSig, CntOutSig functions) - added support for patcher arguments for attributes (use # instead of $ to save them with a patch) - moved memory functions and console output from flext to super-base-class flext_root and derived all helper classes from that diff --git a/externals/grill/flext/flext.vcproj b/externals/grill/flext/flext.vcproj index 659a37ec..9dc85a0c 100644 --- a/externals/grill/flext/flext.vcproj +++ b/externals/grill/flext/flext.vcproj @@ -514,6 +514,7 @@ copy F:\prog\max\flext\pd-msvc\flext.dll f:\prog\dll AdditionalIncludeDirectories="F:\prog\audio\MaxWinSDK\c74support\max-includes,F:\prog\audio\MaxWinSDK\c74support\msp-includes,f:\prog\packs\pthreads,f:\prog\audio\sndobj\include,f:\prog\audio\stk\include" PreprocessorDefinitions="WIN32;_LIB;FLEXT_SYS_MAX;FLEXT_THREADS;FLEXT_USE_SIMD;FLEXT_SHARED;FLEXT_EXPORTS" StringPooling="TRUE" + ExceptionHandling="TRUE" RuntimeLibrary="2" EnableEnhancedInstructionSet="1" RuntimeTypeInfo="TRUE" @@ -528,9 +529,10 @@ copy F:\prog\max\flext\pd-msvc\flext.dll f:\prog\dll Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" - AdditionalDependencies="maxapi.lib maxext.lib maxaudio.lib pthreadVC.lib stk.lib sndobj.lib" + AdditionalDependencies="maxapi.lib maxext.lib maxaudio.lib stk.lib sndobj.lib" OutputFile=".\max-msvc\flext.max.dll" AdditionalLibraryDirectories=""F:\prog\audio\MaxWinSDK\c74support\max-includes\win-includes\debug";"F:\prog\audio\MaxWinSDK\c74support\msp-includes\win-includes\debug";f:\prog\packs\pthreads;F:\prog\audio\stk\lib;F:\prog\audio\sndobj\lib" + IgnoreAllDefaultLibraries="TRUE" GenerateDebugInformation="FALSE" OptimizeReferences="1" ImportLibrary="./max-msvc/flext_l.lib"/> @@ -4441,6 +4443,22 @@ copy F:\prog\max\flext\max-msvc\flext.max.dll f:\prog\dll RelativePath="source\fldefs_setup.h"> </File> </Filter> + <Filter + Name="build" + Filter=""> + <File + RelativePath=".\build-max-msvc.bat"> + </File> + <File + RelativePath=".\build-pd-msvc.bat"> + </File> + <File + RelativePath=".\config-max-msvc.txt"> + </File> + <File + RelativePath=".\config-pd-msvc.txt"> + </File> + </Filter> </Files> <Globals> </Globals> diff --git a/externals/grill/flext/source/flbuf.cpp b/externals/grill/flext/source/flbuf.cpp index e9c02a00..46eb7f4f 100644 --- a/externals/grill/flext/source/flbuf.cpp +++ b/externals/grill/flext/source/flbuf.cpp @@ -194,7 +194,7 @@ void flext::buffer::Frames(int fr,bool keep,bool zero) if(keep) { // copy buffer data to tmp storage - tmp = new t_sample[sz]; + tmp = (t_sample *)NewAligned(sz*sizeof(t_sample)); if(tmp) CopySamples(tmp,data,sz); else @@ -215,7 +215,7 @@ void flext::buffer::Frames(int fr,bool keep,bool zero) if(tmp) { // copy data back CopySamples(data,tmp,sz); - delete[] tmp; + FreeAligned(tmp); if(zero && sz < fr) ZeroSamples(data+sz,fr-sz); } else diff --git a/externals/grill/flext/source/fldsp.cpp b/externals/grill/flext/source/fldsp.cpp index c5d6ea22..b8dce7ca 100644 --- a/externals/grill/flext/source/fldsp.cpp +++ b/externals/grill/flext/source/fldsp.cpp @@ -16,8 +16,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flinternal.h" #include <string.h> - - // === flext_dsp ============================================== #if FLEXT_SYS == FLEXT_SYS_JMAX diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index f8c6fac2..a77726ae 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -88,20 +88,26 @@ void flext::Setup() // ///////////////////////////////////////////////////////// +#define LARGEALLOC 32000 + void *flext_root::operator new(size_t bytes) { bytes += sizeof(size_t); -#ifdef FLEXT_DEBUG - if(bytes > 32000) - post("flext - warning: excessive memory allocation of %i bytes",bytes); -#endif + char *blk; + if(bytes >= LARGEALLOC) { + // use C library function for large memory blocks + blk = (char *)::operator new(bytes); + } + else { + //! \todo We need system locking here for secondary threads! #if FLEXT_SYS == FLEXT_SYS_JMAX - char *blk = (char *)::fts_malloc(bytes); + blk = (char *)::fts_malloc(bytes); #else - char *blk = (char *)::getbytes(bytes); + blk = (char *)::getbytes(bytes); #endif + } *(size_t *)blk = bytes; return blk+sizeof(size_t); @@ -110,13 +116,21 @@ void *flext_root::operator new(size_t bytes) void flext_root::operator delete(void *blk) { char *ori = (char *)blk-sizeof(size_t); + size_t bytes = *(size_t *)ori; + + if(bytes >= LARGEALLOC) { + // use C library function for large memory blocks + ::operator delete(ori); + } + else { + //! \todo We need system locking here for secondary threads! #if FLEXT_SYS == FLEXT_SYS_JMAX - fts_free(ori); + fts_free(ori); #else - size_t bytes = *(size_t *)ori; - ::freebytes(ori,bytes); + ::freebytes(ori,bytes); #endif + } } void *flext_root::NewAligned(size_t bytes,int bitalign) @@ -125,11 +139,20 @@ void *flext_root::NewAligned(size_t bytes,int bitalign) const unsigned long alignovh = bitalign/8-1; bytes += ovh+alignovh; + char *blk; + if(bytes >= LARGEALLOC) { + // use C library function for large memory blocks + blk = (char *)::operator new(bytes); + } + else { + //! \todo We need system locking here for secondary threads! + #if FLEXT_SYS == FLEXT_SYS_JMAX - char *blk = (char *)::fts_malloc(bytes); + blk = (char *)::fts_malloc(bytes); #else - char *blk = (char *)::getbytes(bytes); + blk = (char *)::getbytes(bytes); #endif + } char *ablk = reinterpret_cast<char *>((reinterpret_cast<unsigned long>(blk)+ovh+alignovh) & ~alignovh); *(char **)(ablk-sizeof(size_t)-sizeof(char *)) = blk; @@ -140,13 +163,21 @@ void *flext_root::NewAligned(size_t bytes,int bitalign) void flext_root::FreeAligned(void *blk) { char *ori = *(char **)((char *)blk-sizeof(size_t)-sizeof(char *)); + size_t bytes = *(size_t *)((char *)blk-sizeof(size_t)); + + if(bytes >= LARGEALLOC) { + // use C library function for large memory blocks + ::operator delete(ori); + } + else { + //! \todo We need system locking here for secondary threads! #if FLEXT_SYS == FLEXT_SYS_JMAX - fts_free(ori); + fts_free(ori); #else - size_t bytes = *(size_t *)((char *)blk-sizeof(size_t)); - ::freebytes(ori,bytes); + ::freebytes(ori,bytes); #endif + } } // ------------------------------------------ diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index e8328ea3..2541e243 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -54,13 +54,6 @@ public: void operator delete[](void *blk) { operator delete(blk); } #endif - /*! Get a large memory block - the normal C library function is used here - */ - static void *NewLarge(size_t bytes) { return ::operator new(bytes); } - //! Free a large memory block - static void FreeLarge(void *blk) { ::operator delete(blk); } - //! Get an aligned memory block static void *NewAligned(size_t bytes,int bitalign = 128); //! Free an aligned memory block @@ -69,11 +62,18 @@ public: static bool IsAligned(void *ptr,int bitalign = 128) { return (reinterpret_cast<unsigned long>(ptr)&(bitalign-1)) == 0; } - //! @} FLEXT_S_MEMORY - }; +// define global new/delete operators +inline void *operator new(size_t bytes) { return flext_root::operator new(bytes); } +inline void operator delete(void *blk) { flext_root::operator delete(blk); } +#ifndef __MRC__ // doesn't allow new[] overloading?! +inline void *operator new[](size_t bytes) { return flext_root::operator new[](bytes); } +inline void operator delete[](void *blk) { flext_root::operator delete[](blk); } +#endif + + class FLEXT_SHARE FLEXT_CLASSDEF(flext); typedef class FLEXT_CLASSDEF(flext) flext; diff --git a/externals/grill/guitest/flgui.cpp b/externals/grill/guitest/flgui.cpp index b91f10a4..dc280b4b 100644 --- a/externals/grill/guitest/flgui.cpp +++ b/externals/grill/guitest/flgui.cpp @@ -511,8 +511,15 @@ void flext_gui::SetWidget(t_class *c) widgetbehavior.w_deletefn = sg_delete; widgetbehavior.w_visfn = sg_vis; widgetbehavior.w_clickfn = sg_click; + +#if PD_MINOR_VERSION >= 37 + class_setpropertiesfn(c,sg_properties); + class_setsavefn(c,sg_save); +#else widgetbehavior.w_propertiesfn = sg_properties; widgetbehavior.w_savefn = sg_save; +#endif + class_setwidget(c, &widgetbehavior); } diff --git a/externals/grill/py/config-pd-msvc.txt b/externals/grill/py/config-pd-msvc.txt index ed8f1101..f7fe8316 100644 --- a/externals/grill/py/config-pd-msvc.txt +++ b/externals/grill/py/config-pd-msvc.txt @@ -9,7 +9,8 @@ PDPATH=c:\programme\audio\pd FLEXTPATH=$(PDPATH)\flext # where is MS VC++? -MSVCPATH=C:\Programme\Microsoft Visual Studio .NET 2003\Vc7 +# (not necessary if the build is run with the compiler environment) +# MSVCPATH=C:\Programme\Microsoft Visual Studio .NET 2003\Vc7 # which version of Python? PYTHONVER=python23 diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp index 72396afb..dbcd27f9 100644 --- a/externals/grill/py/source/main.cpp +++ b/externals/grill/py/source/main.cpp @@ -25,7 +25,10 @@ V py::lib_setup() FLEXT_LIB_SETUP(py,py::lib_setup) PyInterpreterState *py::pystate = NULL; + +#ifdef FLEXT_THREADS std::map<flext::thrid_t,PyThreadState *> py::pythrmap; +#endif I py::pyref = 0; PyObject *py::module_obj = NULL; @@ -101,15 +104,20 @@ py::~py() Py_XDECREF(module); PyEval_AcquireLock(); + +#ifdef FLEXT_THREADS PyThreadState_Swap(pythrmap[GetThreadId()]); +#endif #ifdef FLEXT_DEBUG // need not necessarily do that.... Py_Finalize(); #endif +#ifdef FLEXT_THREADS // reset thread state map pythrmap.clear(); +#endif } else { Py_DECREF(module_obj); diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h index 5188b7c3..cf000f9b 100644 --- a/externals/grill/py/source/main.h +++ b/externals/grill/py/source/main.h @@ -116,9 +116,9 @@ protected: public: static PyInterpreterState *pystate; - static std::map<flext::thrid_t,PyThreadState *> pythrmap; #ifdef FLEXT_THREADS + static std::map<flext::thrid_t,PyThreadState *> pythrmap; ThrMutex mutex; V Lock() { mutex.Unlock(); } V Unlock() { mutex.Unlock(); } diff --git a/externals/grill/py/source/pyext.cpp b/externals/grill/py/source/pyext.cpp index a8dc581e..b8763771 100644 --- a/externals/grill/py/source/pyext.cpp +++ b/externals/grill/py/source/pyext.cpp @@ -440,8 +440,9 @@ V pyext::work_wrapper(V *data) // ----------------------------- // store new thread state +#ifdef FLEXT_THREADS pythrmap[GetThreadId()] = newthr; - +#endif { // call worker work_data *w = (work_data *)data; @@ -449,8 +450,10 @@ V pyext::work_wrapper(V *data) delete w; } +#ifdef FLEXT_THREADS // delete mapped thread state pythrmap.erase(GetThreadId()); +#endif // --- delete Python thread --- // grab the lock diff --git a/externals/grill/xsample/xsample.vcproj b/externals/grill/xsample/xsample.vcproj index c64e084b..98f28c32 100644 --- a/externals/grill/xsample/xsample.vcproj +++ b/externals/grill/xsample/xsample.vcproj @@ -39,7 +39,7 @@ Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" - AdditionalDependencies="pd.lib flext-pdwin.lib" + AdditionalDependencies="pd.lib " OutputFile="pd-msvc\xsample.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" |