Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Statics

Date2016-12-29 18:00
Fromjpff
Subject[Csnd-dev] Statics
This a first attempt to classify static data items.   ?? means I am not
sure, bad is bad, suspect is I have not investigated

Re flowgraph I think either we have to accept the memory leak, or add a
field to the CSOUND structure
==John ffitch

UNCHECKED YET
InOut/ipmidi.c:    static int sock;
InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
InOut/widgets.cpp:        static int  flag = 0;
Opcodes/buchla.c:static int warn = 0;
Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
Opcodes/doppler.cpp:static std::list delayLineInstances;
Opcodes/dssi4cs/src/dssi4cs.c:static void
Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
Opcodes/fm4op.c:static int      FM_tabs_built = 0;
Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
Opcodes/linuxjoystick.c:    static int read_pos = 0;

??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
??                             Opcodes/pinker.c:static int instance_cnt = 0;
bad                            Opcodes/sfont.c:static char *Gfname;
reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
bad                            Top/argdecode.c:static FILE *logFile = NULL;
suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
suspect                        Top/cscorfns.c:static int    warpout = 0;
suspect                        Top/csound.c:static  volatile  int init_done = 0;
suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
??                             interfaces/Soundfile.hpp:  static double buffer[16];
??                             interfaces/Soundfile.hpp:  static double buffer[16];
??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 18:41
FromSteven Yi
SubjectRe: [Csnd-dev] Statics
In terms of extensibility, can't we just use the CSOUND instance's
global variable system, rather than adding more members to the struct?
 It seems to me that we could actually be using that more to query/add
variables global to a CSOUND instance.

On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
> This a first attempt to classify static data items.   ?? means I am not
> sure, bad is bad, suspect is I have not investigated
>
> Re flowgraph I think either we have to accept the memory leak, or add a
> field to the CSOUND structure
> ==John ffitch
>
> UNCHECKED YET
> InOut/ipmidi.c:    static int sock;
> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
> InOut/widgets.cpp:        static int  flag = 0;
> Opcodes/buchla.c:static int warn = 0;
> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
> Opcodes/doppler.cpp:static std::list delayLineInstances;
> Opcodes/dssi4cs/src/dssi4cs.c:static void
> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>
> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
> bad                            Opcodes/sfont.c:static char *Gfname;
> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
> bad                            Top/argdecode.c:static FILE *logFile = NULL;
> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
> suspect                        Top/cscorfns.c:static int    warpout = 0;
> suspect                        Top/csound.c:static  volatile  int init_done = 0;
> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 18:50
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Statics
Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
vars are cleared on Reset anyway.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
> 
> In terms of extensibility, can't we just use the CSOUND instance's
> global variable system, rather than adding more members to the struct?
> It seems to me that we could actually be using that more to query/add
> variables global to a CSOUND instance.
> 
>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>> This a first attempt to classify static data items.   ?? means I am not
>> sure, bad is bad, suspect is I have not investigated
>> 
>> Re flowgraph I think either we have to accept the memory leak, or add a
>> field to the CSOUND structure
>> ==John ffitch
>> 
>> UNCHECKED YET
>> InOut/ipmidi.c:    static int sock;
>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>> InOut/widgets.cpp:        static int  flag = 0;
>> Opcodes/buchla.c:static int warn = 0;
>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>> 
>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>> bad                            Opcodes/sfont.c:static char *Gfname;
>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.
>> ??                             interfaces/Soundfile.hpp:     * In Python

Date2016-12-29 19:05
FromSteven Yi
SubjectRe: [Csnd-dev] Statics
Just a sidenote, working with Menno now on Slack and the use of the
signalflowgraph stuff (in this case, ftgenonce), something is still
wrong and crashing Blue.   I'm going to take a stab at storing the
locks in the global var space.

On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
 wrote:
> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
> vars are cleared on Reset anyway.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>
>> In terms of extensibility, can't we just use the CSOUND instance's
>> global variable system, rather than adding more members to the struct?
>> It seems to me that we could actually be using that more to query/add
>> variables global to a CSOUND instance.
>>
>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>> This a first attempt to classify static data items.   ?? means I am not
>>> sure, bad is bad, suspect is I have not investigated
>>>
>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>> field to the CSOUND structure
>>> ==John ffitch
>>>
>>> UNCHECKED YET
>>> InOut/ipmidi.c:    static int sock;
>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>> InOut/widgets.cpp:        static int  flag = 0;
>>> Opcodes/buchla.c:static int warn = 0;
>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>
>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 19:07
FromJohn ff
SubjectRe: [Csnd-dev] Statics
Is allocation of global structures safe?

Sent from TypeApp
On 29 Dec 2016, at 18:42, Steven Yi <stevenyi@GMAIL.COM> wrote:
In terms of extensibility, can't we just use the CSOUND instance's
global variable system, rather than adding more members to the struct?
It seems to me that we could actually be using that more to query/add
variables global to a CSOUND instance.

On Thu, Dec 29, 2016 at 1:00 PM, jpff <jpff@codemist.co.uk> wrote:
This a first attempt to classify static data items. ?? means I am not
sure, bad is bad, suspect is I have not investigated

Re flowgraph I think either we have to accept the memory leak, or add a
field to the CSOUND structure
==John ffitch

UNCHECKED YET
InOut/ipmidi.c: static int sock;< br> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
InOut/widgets.cpp: static int flag = 0;
Opcodes/buchla.c:static int warn = 0;
Opcodes/doppler.cpp:static std::list<RCLowpassFilter *> smoothingFilterInstances;
Opcodes/doppler.cpp:static std::list<DelayLine *> delayLineInstances;
Opcodes/dssi4cs/src/dssi4cs.c:static void
Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
Opcodes/fm4op.c:static int FM_tabs_built = 0;
Opcodes/fm4op.c:static MYFLT FM4Op_gains[100];
Opcodes/fm4op.c:static MYFLT FM4Op_susLevels[16];
Opcodes/fm4op.c:static MYFLT FM4Op_attTimes[32];
Opcodes/gab/newgabopc.c: static MYFLT frac = 0;
Opcodes/linuxjoystick.c: static int read_pos = 0;

?? Engine/csound_orc_expressions.c:static int genlabs = 300;
?? Opcodes/pinker.c:static int instance_cnt = 0;
bad Opcodes/sfont.c:static char *Gfname;
reset issue Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
reset issue Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
suspect Opcodes/vst4cs/src/fxbank.cpp: static long lChnk = 'CcnK';
suspect Opcodes/vst4cs/src/fxbank.h: static CVSTHost * pHost;
suspect Opcodes/vst4cs/src/vst4cs.cpp: static std::vector<VSTPlugin*> vstPlugEditors_;
suspect Opcodes/vst4cs/src/vst4cs.cpp: static std::vector<VSTPlugin*> vstPlugins_;
suspect Opcodes/vst4cs/src/vst host.h: static std::map<long, std::string> masterOpcodes_;
suspect Opcodes/vst4cs/src/vsthost.h: static std::map<long, std::string> dispatchOpcodes_;
suspect Opcodes/vst4cs/src/vsthost.h: static size_t opcodeRefCount_ = 0;
bad Top/argdecode.c:static FILE *logFile = NULL;
suspect Top/cscorfns.c:static EVENT *evtmp = NULL;
suspect Top/cscorfns.c:static EVTBLK *evtmpblk;
suspect Top/cscorfns.c:static SPACE spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
suspect Top/cscorfns.c:static int warpout = 0;
suspect Top/csound.c:static volatile int init_done = 0;
suspect Top/csound.c:static volatile csInstance_t *instance_list = NULL;
suspect Top/csound.c:static vola tile int exitNow_ = 0;
?? Top/csound.c:static double timeResolutionSeconds = -1.0;
?? interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
?? interfaces/CsoundFile.cpp: buffer = staticBuffer;
?? interfaces/Soundfile.hpp: static double buffer[16];
?? interfaces/Soundfile.hpp: static double buffer[16];
?? interfaces/Soundfile.hpp: * In Python this function is not thread-safe, as a static buffer is used internally.
?? interfaces/Soundfile.hpp: * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 19:13
FromSteven Yi
SubjectRe: [Csnd-dev] Statics
BTW: this code in signalflowgraph seems awfully off in terms of mutex
locks/unlocks.  I've found unlocks with no locks, two unlocks instead
of a lock/unlock, etc...

On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
> Just a sidenote, working with Menno now on Slack and the use of the
> signalflowgraph stuff (in this case, ftgenonce), something is still
> wrong and crashing Blue.   I'm going to take a stab at storing the
> locks in the global var space.
>
> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>  wrote:
>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>> vars are cleared on Reset anyway.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>
>>> In terms of extensibility, can't we just use the CSOUND instance's
>>> global variable system, rather than adding more members to the struct?
>>> It seems to me that we could actually be using that more to query/add
>>> variables global to a CSOUND instance.
>>>
>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>> This a first attempt to classify static data items.   ?? means I am not
>>>> sure, bad is bad, suspect is I have not investigated
>>>>
>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>> field to the CSOUND structure
>>>> ==John ffitch
>>>>
>>>> UNCHECKED YET
>>>> InOut/ipmidi.c:    static int sock;
>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>> Opcodes/buchla.c:static int warn = 0;
>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>
>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 19:41
FromSteven Yi
SubjectRe: [Csnd-dev] Statics
I've put in a change for the signalflowgraph code that replaces the
static with the use of a Csound global variable.  It'd be good to have
this reviewed, but so far I'm no longer getting any crashes with
ftgenonce.

https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9

On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
> BTW: this code in signalflowgraph seems awfully off in terms of mutex
> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
> of a lock/unlock, etc...
>
> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>> Just a sidenote, working with Menno now on Slack and the use of the
>> signalflowgraph stuff (in this case, ftgenonce), something is still
>> wrong and crashing Blue.   I'm going to take a stab at storing the
>> locks in the global var space.
>>
>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>  wrote:
>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>> vars are cleared on Reset anyway.
>>>
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>>
>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>
>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>> global variable system, rather than adding more members to the struct?
>>>> It seems to me that we could actually be using that more to query/add
>>>> variables global to a CSOUND instance.
>>>>
>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>
>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>> field to the CSOUND structure
>>>>> ==John ffitch
>>>>>
>>>>> UNCHECKED YET
>>>>> InOut/ipmidi.c:    static int sock;
>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>
>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 19:57
FromMichael Gogins
SubjectRe: [Csnd-dev] Statics
The question is, does this global persist when an instance of Csound
is destroyed? That is what is required by the use case of multiple
Csound instances, e.g. VST plugins, in a single process, e.g. a
digital audio workstation.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
> I've put in a change for the signalflowgraph code that replaces the
> static with the use of a Csound global variable.  It'd be good to have
> this reviewed, but so far I'm no longer getting any crashes with
> ftgenonce.
>
> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>
> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>> of a lock/unlock, etc...
>>
>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>> Just a sidenote, working with Menno now on Slack and the use of the
>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>> locks in the global var space.
>>>
>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>  wrote:
>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>> vars are cleared on Reset anyway.
>>>>
>>>> Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>
>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>> global variable system, rather than adding more members to the struct?
>>>>> It seems to me that we could actually be using that more to query/add
>>>>> variables global to a CSOUND instance.
>>>>>
>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>
>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>> field to the CSOUND structure
>>>>>> ==John ffitch
>>>>>>
>>>>>> UNCHECKED YET
>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>
>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 20:27
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Statics
There is a mechanism for that in Csound.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 Dec 2016, at 19:07, John ff <jpff@CODEMIST.CO.UK> wrote:

Is allocation of global structures safe?

Sent from TypeApp
On 29 Dec 2016, at 18:42, Steven Yi <stevenyi@GMAIL.COM> wrote:
In terms of extensibility, can't we just use the CSOUND instance's
global variable system, rather than adding more members to the struct?
It seems to me that we could actually be using that more to query/add
variables global to a CSOUND instance.

On Thu, Dec 29, 2016 at 1:00 PM, jpff <jpff@codemist.co.uk> wrote:
This a first attempt to classify static data items. ?? means I am not
sure, bad is bad, suspect is I have not investigated

Re flowgraph I think either we have to accept the memory leak, or add a
field to the CSOUND structure
==John ffitch

UNCHECKED YET
InOut/ipmidi.c: static int sock;
InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
InOut/widgets.cpp: static int flag = 0;
Opcodes/buchla.c:static int warn = 0;
Opcodes/doppler.cpp:static std::list<RCLowpassFilter *> smoothingFilterInstances;
Opcodes/doppler.cpp:static std::list<DelayLine *> delayLineInstances;
Opcodes/dssi4cs/src/dssi4cs.c:static void
Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
Opcodes/fm4op.c:static int FM_tabs_built = 0;
Opcodes/fm4op.c:static MYFLT FM4Op_gains[100];
Opcodes/fm4op.c:static MYFLT FM4Op_susLevels[16];
Opcodes/fm4op.c:static MYFLT FM4Op_attTimes[32];
Opcodes/gab/newgabopc.c: static MYFLT frac = 0;
Opcodes/linuxjoystick.c: static int read_pos = 0;

?? Engine/csound_orc_expressions.c:static int genlabs = 300;
?? Opcodes/pinker.c:static int instance_cnt = 0;
bad Opcodes/sfont.c:static char *Gfname;
reset issue Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
reset issue Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
suspect Opcodes/vst4cs/src/fxbank.cpp: static long lChnk = 'CcnK';
suspect Opcodes/vst4cs/src/fxbank.h: static CVSTHost * pHost;
suspect Opcodes/vst4cs/src/vst4cs.cpp: static std::vector<VSTPlugin*> vstPlugEditors_;
suspect Opcodes/vst4cs/src/vst4cs.cpp: static std::vector<VSTPlugin*> vstPlugins_;
suspect Opcodes/vst4cs/src/vsthost.h: static std::map<long, std::string> masterOpcodes_;
suspect Opcodes/vst4cs/src/vsthost.h: static std::map<long, std::string> dispatchOpcodes_;
suspect Opcodes/vst4cs/src/vsthost.h: static size_t opcodeRefCount_ = 0;
bad Top/argdecode.c:static FILE *logFile = NULL;
suspect Top/cscorfns.c:static EVENT *evtmp = NULL;
suspect Top/cscorfns.c:static EVTBLK *evtmpblk;
suspect Top/cscorfns.c:static SPACE spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
suspect Top/cscorfns.c:static int warpout = 0;
suspect Top/csound.c:static volatile int init_done = 0;
suspect Top/csound.c:static volatile csInstance_t *instance_list = NULL;
suspect Top/csound.c:static volatile int exitNow_ = 0;
?? Top/csound.c:static double timeResolutionSeconds = -1.0;
?? interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
?? interfaces/CsoundFile.cpp: buffer = staticBuffer;
?? interfaces/Soundfile.hpp: static double buffer[16];
?? interfaces/Soundfile.hpp: static double buffer[16];
?? interfaces/Soundfile.hpp: * In Python this function is not thread-safe, as a static buffer is used internally.
?? interfaces/Soundfile.hpp: * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 20:28
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Statics
We need to be able to reset Csound into a clean state without leaking memory.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 29 Dec 2016, at 19:58, Michael Gogins  wrote:
> 
> The question is, does this global persist when an instance of Csound
> is destroyed? That is what is required by the use case of multiple
> Csound instances, e.g. VST plugins, in a single process, e.g. a
> digital audio workstation.
> 
> Regards,
> Mike
> 
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
> 
> 
>> On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
>> I've put in a change for the signalflowgraph code that replaces the
>> static with the use of a Csound global variable.  It'd be good to have
>> this reviewed, but so far I'm no longer getting any crashes with
>> ftgenonce.
>> 
>> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>> 
>>> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>>> of a lock/unlock, etc...
>>> 
>>>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>>> Just a sidenote, working with Menno now on Slack and the use of the
>>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>>> locks in the global var space.
>>>> 
>>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>>  wrote:
>>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>>> vars are cleared on Reset anyway.
>>>>> 
>>>>> Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> Maynooth University
>>>>> Ireland
>>>>> 
>>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>> 
>>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>>> global variable system, rather than adding more members to the struct?
>>>>>> It seems to me that we could actually be using that more to query/add
>>>>>> variables global to a CSOUND instance.
>>>>>> 
>>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>> 
>>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>>> field to the CSOUND structure
>>>>>>> ==John ffitch
>>>>>>> 
>>>>>>> UNCHECKED YET
>>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>> 
>>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.
>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internal

Date2016-12-29 20:35
FromSteven Yi
SubjectRe: [Csnd-dev] Statics
No, it does not; perhaps I misinterpreted the code. The previous code
did not work though and crashed Blue (and perhaps other API-based
apps). That it is now working might not have been from just the change
from static to csound global var I did, but also that I fixed up the
lock/unlock pairs.

Either way, Menno and I can now at least run Blue without it crashing.
Perhaps rather than have a C++ map from CSOUND* to channel lists, the
code could be modified to just store the channel lists within a class,
and have that class be registered with the CSOUND global var
mechanism.  That would get rid of all of those statics I think.


On Thu, Dec 29, 2016 at 2:57 PM, Michael Gogins
 wrote:
> The question is, does this global persist when an instance of Csound
> is destroyed? That is what is required by the use case of multiple
> Csound instances, e.g. VST plugins, in a single process, e.g. a
> digital audio workstation.
>
> Regards,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
>> I've put in a change for the signalflowgraph code that replaces the
>> static with the use of a Csound global variable.  It'd be good to have
>> this reviewed, but so far I'm no longer getting any crashes with
>> ftgenonce.
>>
>> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>>
>> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>>> of a lock/unlock, etc...
>>>
>>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>>> Just a sidenote, working with Menno now on Slack and the use of the
>>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>>> locks in the global var space.
>>>>
>>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>>  wrote:
>>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>>> vars are cleared on Reset anyway.
>>>>>
>>>>> Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>>
>>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>>> global variable system, rather than adding more members to the struct?
>>>>>> It seems to me that we could actually be using that more to query/add
>>>>>> variables global to a CSOUND instance.
>>>>>>
>>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>>
>>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>>> field to the CSOUND structure
>>>>>>> ==John ffitch
>>>>>>>
>>>>>>> UNCHECKED YET
>>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>>
>>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 20:39
FromMichael Gogins
SubjectRe: [Csnd-dev] Statics
Thanks for fixing the lock/unlock sequences.

I will think about your suggestion. A simpler solution would be an
atexit function to decallocate the mutexes. I have tested that and it
works.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Dec 29, 2016 at 3:35 PM, Steven Yi  wrote:
> No, it does not; perhaps I misinterpreted the code. The previous code
> did not work though and crashed Blue (and perhaps other API-based
> apps). That it is now working might not have been from just the change
> from static to csound global var I did, but also that I fixed up the
> lock/unlock pairs.
>
> Either way, Menno and I can now at least run Blue without it crashing.
> Perhaps rather than have a C++ map from CSOUND* to channel lists, the
> code could be modified to just store the channel lists within a class,
> and have that class be registered with the CSOUND global var
> mechanism.  That would get rid of all of those statics I think.
>
>
> On Thu, Dec 29, 2016 at 2:57 PM, Michael Gogins
>  wrote:
>> The question is, does this global persist when an instance of Csound
>> is destroyed? That is what is required by the use case of multiple
>> Csound instances, e.g. VST plugins, in a single process, e.g. a
>> digital audio workstation.
>>
>> Regards,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
>>> I've put in a change for the signalflowgraph code that replaces the
>>> static with the use of a Csound global variable.  It'd be good to have
>>> this reviewed, but so far I'm no longer getting any crashes with
>>> ftgenonce.
>>>
>>> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>>>
>>> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>>>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>>>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>>>> of a lock/unlock, etc...
>>>>
>>>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>>>> Just a sidenote, working with Menno now on Slack and the use of the
>>>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>>>> locks in the global var space.
>>>>>
>>>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>>>  wrote:
>>>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>>>> vars are cleared on Reset anyway.
>>>>>>
>>>>>> Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>>>
>>>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>>>> global variable system, rather than adding more members to the struct?
>>>>>>> It seems to me that we could actually be using that more to query/add
>>>>>>> variables global to a CSOUND instance.
>>>>>>>
>>>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>>>
>>>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>>>> field to the CSOUND structure
>>>>>>>> ==John ffitch
>>>>>>>>
>>>>>>>> UNCHECKED YET
>>>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>>>
>>>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 20:43
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Statics
This will not fix the problem of leaks at CsoundReset. On consecutive loads of plugins memory will leak. A

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 29 Dec 2016, at 20:40, Michael Gogins  wrote:
> 
> Thanks for fixing the lock/unlock sequences.
> 
> I will think about your suggestion. A simpler solution would be an
> atexit function to decallocate the mutexes. I have tested that and it
> works.
> 
> Best,
> Mike
> 
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
> 
> 
>> On Thu, Dec 29, 2016 at 3:35 PM, Steven Yi  wrote:
>> No, it does not; perhaps I misinterpreted the code. The previous code
>> did not work though and crashed Blue (and perhaps other API-based
>> apps). That it is now working might not have been from just the change
>> from static to csound global var I did, but also that I fixed up the
>> lock/unlock pairs.
>> 
>> Either way, Menno and I can now at least run Blue without it crashing.
>> Perhaps rather than have a C++ map from CSOUND* to channel lists, the
>> code could be modified to just store the channel lists within a class,
>> and have that class be registered with the CSOUND global var
>> mechanism.  That would get rid of all of those statics I think.
>> 
>> 
>> On Thu, Dec 29, 2016 at 2:57 PM, Michael Gogins
>>  wrote:
>>> The question is, does this global persist when an instance of Csound
>>> is destroyed? That is what is required by the use case of multiple
>>> Csound instances, e.g. VST plugins, in a single process, e.g. a
>>> digital audio workstation.
>>> 
>>> Regards,
>>> Mike
>>> 
>>> -----------------------------------------------------
>>> Michael Gogins
>>> Irreducible Productions
>>> http://michaelgogins.tumblr.com
>>> Michael dot Gogins at gmail dot com
>>> 
>>> 
>>>> On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
>>>> I've put in a change for the signalflowgraph code that replaces the
>>>> static with the use of a Csound global variable.  It'd be good to have
>>>> this reviewed, but so far I'm no longer getting any crashes with
>>>> ftgenonce.
>>>> 
>>>> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>>>> 
>>>>> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>>>>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>>>>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>>>>> of a lock/unlock, etc...
>>>>> 
>>>>>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>>>>> Just a sidenote, working with Menno now on Slack and the use of the
>>>>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>>>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>>>>> locks in the global var space.
>>>>>> 
>>>>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>>>>  wrote:
>>>>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>>>>> vars are cleared on Reset anyway.
>>>>>>> 
>>>>>>> Victor Lazzarini
>>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>> 
>>>>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>>>> 
>>>>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>>>>> global variable system, rather than adding more members to the struct?
>>>>>>>> It seems to me that we could actually be using that more to query/add
>>>>>>>> variables global to a CSOUND instance.
>>>>>>>> 
>>>>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>>>> 
>>>>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>>>>> field to the CSOUND structure
>>>>>>>>> ==John ffitch
>>>>>>>>> 
>>>>>>>>> UNCHECKED YET
>>>>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>>>> 
>>>>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.
>>>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used intern

Date2016-12-29 20:49
FromMichael Gogins
SubjectRe: [Csnd-dev] Statics
Your remark is cryptic. How can Csound create a global variable that
persists when csoundDestroy or csoundReset is called?

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Dec 29, 2016 at 3:27 PM, Victor Lazzarini
 wrote:
> There is a mechanism for that in Csound.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 29 Dec 2016, at 19:07, John ff  wrote:
>
> Is allocation of global structures safe?
>
> Sent from TypeApp
> On 29 Dec 2016, at 18:42, Steven Yi  wrote:
>>
>> In terms of extensibility, can't we just use the CSOUND instance's
>> global variable system, rather than adding more members to the struct?
>>  It seems to me that we could actually be using that more to query/add
>> variables global to a CSOUND instance.
>>
>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>
>>>  This a first attempt to classify static data items.   ?? means I am not
>>>  sure, bad is bad, suspect is I have not investigated
>>>
>>>  Re flowgraph I think either we have to accept the memory leak, or add a
>>>  field to the CSOUND structure
>>>  ==John ffitch
>>>
>>>  UNCHECKED YET
>>>  InOut/ipmidi.c:    static int sock;
>>>  InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>  InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>  InOut/widgets.cpp:        static int  flag = 0;
>>>
>>> Opcodes/buchla.c:static int warn = 0;
>>>  Opcodes/doppler.cpp:static std::list
>>> smoothingFilterInstances;
>>>  Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>  Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>  Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>  Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter,
>>> are static linear
>>>  Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems
>>> with the order of static initializations.
>>>  Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>  Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>  Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>  Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>  Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>  Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>
>>>  ??                             Engine/csound_orc_expressions.c:static
>>> int genlabs = 300;
>>>  ??
>>> Opcodes/pinker.c:static int instance_cnt = 0;
>>>  bad                            Opcodes/sfont.c:static char *Gfname;
>>>  reset issue                    Opcodes/signalflowgraph.cpp:static void*
>>> cs_sfg_ftables = 0;
>>>  reset issue                    Opcodes/signalflowgraph.cpp:static void*
>>> cs_sfg_ports = 0;
>>>  suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static
>>> long lChnk = 'CcnK';
>>>  suspect                        Opcodes/vst4cs/src/fxbank.h:
>>> static CVSTHost * pHost;
>>>  suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static
>>> std::vector vstPlugEditors_;
>>>  suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static
>>> std::vector vstPlugins_;
>>>  suspect                        Opcodes/vst4cs/src/vsthost.h:    static
>>> std::map masterOpcodes_;
>>>  suspect                        Opcodes/vst4cs/src/vsthost.h:    static
>>> std::map
>>> dispatchOpcodes_;
>>>  suspect                        Opcodes/vst4cs/src/vsthost.h:    static
>>> size_t opcodeRefCount_ = 0;
>>>  bad                            Top/argdecode.c:static FILE *logFile =
>>> NULL;
>>>  suspect                        Top/cscorfns.c:static  EVENT  *evtmp =
>>> NULL;
>>>  suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>  suspect                        Top/cscorfns.c:static SPACE  spaceanchor
>>> = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>  suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>  suspect                        Top/csound.c:static  volatile  int
>>> init_done = 0;
>>>  suspect                        Top/csound.c:static  volatile
>>> csInstance_t  *instance_list = NULL;
>>>  suspect                        Top/csound.c:static  volatile  int
>>> exitNow_ = 0;
>>>  ??                             Top/csound.c:static double
>>> timeResolutionSeconds = -1.0;
>>>  ??                             interfaces/CsoundFile.cpp:char
>>> staticBuffer[0x1000];
>>>  ??                             interfaces/CsoundFile.cpp:  buffer =
>>> staticBuffer;
>>>  ??                             interfaces/Soundfile.hpp:  static double
>>> buffer[16];
>>>  ??                             interfaces/Soundfile.hpp:  static double
>>> buffer[16];
>>>  ??                             interfaces/Soundfile.hpp:     * In Python
>>> this function is not thread-safe, as a static buffer is used internally.
>>>  ??                             interfaces/Soundfile.hpp:     * In Python

Date2016-12-29 20:59
FromSteven Yi
SubjectRe: [Csnd-dev] Statics
Atexit won't work for me as it interferes with Java's atexit handler.
I have to use CSOUND_NO_ATEXIT (or whatever the flag is) when I run
Csound or otherwise I have problems.

On Thu, Dec 29, 2016 at 3:39 PM, Michael Gogins
 wrote:
> Thanks for fixing the lock/unlock sequences.
>
> I will think about your suggestion. A simpler solution would be an
> atexit function to decallocate the mutexes. I have tested that and it
> works.
>
> Best,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Thu, Dec 29, 2016 at 3:35 PM, Steven Yi  wrote:
>> No, it does not; perhaps I misinterpreted the code. The previous code
>> did not work though and crashed Blue (and perhaps other API-based
>> apps). That it is now working might not have been from just the change
>> from static to csound global var I did, but also that I fixed up the
>> lock/unlock pairs.
>>
>> Either way, Menno and I can now at least run Blue without it crashing.
>> Perhaps rather than have a C++ map from CSOUND* to channel lists, the
>> code could be modified to just store the channel lists within a class,
>> and have that class be registered with the CSOUND global var
>> mechanism.  That would get rid of all of those statics I think.
>>
>>
>> On Thu, Dec 29, 2016 at 2:57 PM, Michael Gogins
>>  wrote:
>>> The question is, does this global persist when an instance of Csound
>>> is destroyed? That is what is required by the use case of multiple
>>> Csound instances, e.g. VST plugins, in a single process, e.g. a
>>> digital audio workstation.
>>>
>>> Regards,
>>> Mike
>>>
>>> -----------------------------------------------------
>>> Michael Gogins
>>> Irreducible Productions
>>> http://michaelgogins.tumblr.com
>>> Michael dot Gogins at gmail dot com
>>>
>>>
>>> On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
>>>> I've put in a change for the signalflowgraph code that replaces the
>>>> static with the use of a Csound global variable.  It'd be good to have
>>>> this reviewed, but so far I'm no longer getting any crashes with
>>>> ftgenonce.
>>>>
>>>> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>>>>
>>>> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>>>>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>>>>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>>>>> of a lock/unlock, etc...
>>>>>
>>>>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>>>>> Just a sidenote, working with Menno now on Slack and the use of the
>>>>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>>>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>>>>> locks in the global var space.
>>>>>>
>>>>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>>>>  wrote:
>>>>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>>>>> vars are cleared on Reset anyway.
>>>>>>>
>>>>>>> Victor Lazzarini
>>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>>
>>>>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>>>>
>>>>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>>>>> global variable system, rather than adding more members to the struct?
>>>>>>>> It seems to me that we could actually be using that more to query/add
>>>>>>>> variables global to a CSOUND instance.
>>>>>>>>
>>>>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>>>>
>>>>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>>>>> field to the CSOUND structure
>>>>>>>>> ==John ffitch
>>>>>>>>>
>>>>>>>>> UNCHECKED YET
>>>>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>>>>
>>>>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.

Date2016-12-29 21:27
FromMichael Gogins
SubjectRe: [Csnd-dev] Statics
OK, no atexit.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Dec 29, 2016 at 3:59 PM, Steven Yi  wrote:
> Atexit won't work for me as it interferes with Java's atexit handler.
> I have to use CSOUND_NO_ATEXIT (or whatever the flag is) when I run
> Csound or otherwise I have problems.
>
> On Thu, Dec 29, 2016 at 3:39 PM, Michael Gogins
>  wrote:
>> Thanks for fixing the lock/unlock sequences.
>>
>> I will think about your suggestion. A simpler solution would be an
>> atexit function to decallocate the mutexes. I have tested that and it
>> works.
>>
>> Best,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Thu, Dec 29, 2016 at 3:35 PM, Steven Yi  wrote:
>>> No, it does not; perhaps I misinterpreted the code. The previous code
>>> did not work though and crashed Blue (and perhaps other API-based
>>> apps). That it is now working might not have been from just the change
>>> from static to csound global var I did, but also that I fixed up the
>>> lock/unlock pairs.
>>>
>>> Either way, Menno and I can now at least run Blue without it crashing.
>>> Perhaps rather than have a C++ map from CSOUND* to channel lists, the
>>> code could be modified to just store the channel lists within a class,
>>> and have that class be registered with the CSOUND global var
>>> mechanism.  That would get rid of all of those statics I think.
>>>
>>>
>>> On Thu, Dec 29, 2016 at 2:57 PM, Michael Gogins
>>>  wrote:
>>>> The question is, does this global persist when an instance of Csound
>>>> is destroyed? That is what is required by the use case of multiple
>>>> Csound instances, e.g. VST plugins, in a single process, e.g. a
>>>> digital audio workstation.
>>>>
>>>> Regards,
>>>> Mike
>>>>
>>>> -----------------------------------------------------
>>>> Michael Gogins
>>>> Irreducible Productions
>>>> http://michaelgogins.tumblr.com
>>>> Michael dot Gogins at gmail dot com
>>>>
>>>>
>>>> On Thu, Dec 29, 2016 at 2:41 PM, Steven Yi  wrote:
>>>>> I've put in a change for the signalflowgraph code that replaces the
>>>>> static with the use of a Csound global variable.  It'd be good to have
>>>>> this reviewed, but so far I'm no longer getting any crashes with
>>>>> ftgenonce.
>>>>>
>>>>> https://github.com/csound/csound/commit/6c27add710249bd0f8afd850ba3ca6e606f119f9
>>>>>
>>>>> On Thu, Dec 29, 2016 at 2:13 PM, Steven Yi  wrote:
>>>>>> BTW: this code in signalflowgraph seems awfully off in terms of mutex
>>>>>> locks/unlocks.  I've found unlocks with no locks, two unlocks instead
>>>>>> of a lock/unlock, etc...
>>>>>>
>>>>>> On Thu, Dec 29, 2016 at 2:05 PM, Steven Yi  wrote:
>>>>>>> Just a sidenote, working with Menno now on Slack and the use of the
>>>>>>> signalflowgraph stuff (in this case, ftgenonce), something is still
>>>>>>> wrong and crashing Blue.   I'm going to take a stab at storing the
>>>>>>> locks in the global var space.
>>>>>>>
>>>>>>> On Thu, Dec 29, 2016 at 1:50 PM, Victor Lazzarini
>>>>>>>  wrote:
>>>>>>>> Not sure adding a plugin var to the CSOUND is a possibility here. Steven's suggestion is better. However neither will fix the problem, because the memory will need to be cleared at some point, and besides Csound global
>>>>>>>> vars are cleared on Reset anyway.
>>>>>>>>
>>>>>>>> Victor Lazzarini
>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>>>> Maynooth University
>>>>>>>> Ireland
>>>>>>>>
>>>>>>>>> On 29 Dec 2016, at 18:41, Steven Yi  wrote:
>>>>>>>>>
>>>>>>>>> In terms of extensibility, can't we just use the CSOUND instance's
>>>>>>>>> global variable system, rather than adding more members to the struct?
>>>>>>>>> It seems to me that we could actually be using that more to query/add
>>>>>>>>> variables global to a CSOUND instance.
>>>>>>>>>
>>>>>>>>>> On Thu, Dec 29, 2016 at 1:00 PM, jpff  wrote:
>>>>>>>>>> This a first attempt to classify static data items.   ?? means I am not
>>>>>>>>>> sure, bad is bad, suspect is I have not investigated
>>>>>>>>>>
>>>>>>>>>> Re flowgraph I think either we have to accept the memory leak, or add a
>>>>>>>>>> field to the CSOUND structure
>>>>>>>>>> ==John ffitch
>>>>>>>>>>
>>>>>>>>>> UNCHECKED YET
>>>>>>>>>> InOut/ipmidi.c:    static int sock;
>>>>>>>>>> InOut/pmidi.c:static unsigned long portmidi_init_cnt = 0UL;
>>>>>>>>>> InOut/virtual_keyboard/Bank.cpp:static char* gm[] = {
>>>>>>>>>> InOut/widgets.cpp:        static int  flag = 0;
>>>>>>>>>> Opcodes/buchla.c:static int warn = 0;
>>>>>>>>>> Opcodes/doppler.cpp:static std::list smoothingFilterInstances;
>>>>>>>>>> Opcodes/doppler.cpp:static std::list delayLineInstances;
>>>>>>>>>> Opcodes/dssi4cs/src/dssi4cs.c:static void
>>>>>>>>>> Opcodes/fareygen.c:static NGFENS farey_fgens[] = {
>>>>>>>>>> Opcodes/filter.c: * Whereas the above two opcodes, filter and kfilter, are static linear
>>>>>>>>>> Opcodes/fluidOpcodes/fluidOpcodes.cpp: * This may help avoid problems with the order of static initializations.
>>>>>>>>>> Opcodes/fm4op.c:static int      FM_tabs_built = 0;
>>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_gains[100];
>>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_susLevels[16];
>>>>>>>>>> Opcodes/fm4op.c:static MYFLT    FM4Op_attTimes[32];
>>>>>>>>>> Opcodes/gab/newgabopc.c:     static MYFLT frac = 0;
>>>>>>>>>> Opcodes/linuxjoystick.c:    static int read_pos = 0;
>>>>>>>>>>
>>>>>>>>>> ??                             Engine/csound_orc_expressions.c:static int genlabs = 300;
>>>>>>>>>> ??                             Opcodes/pinker.c:static int instance_cnt = 0;
>>>>>>>>>> bad                            Opcodes/sfont.c:static char *Gfname;
>>>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ftables = 0;
>>>>>>>>>> reset issue                    Opcodes/signalflowgraph.cpp:static void* cs_sfg_ports = 0;
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.cpp:    static long lChnk = 'CcnK';
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/fxbank.h:        static CVSTHost * pHost;
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugEditors_;
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/vst4cs.cpp:    static std::vector vstPlugins_;
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map masterOpcodes_;
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static std::map dispatchOpcodes_;
>>>>>>>>>> suspect                        Opcodes/vst4cs/src/vsthost.h:    static size_t opcodeRefCount_ = 0;
>>>>>>>>>> bad                            Top/argdecode.c:static FILE *logFile = NULL;
>>>>>>>>>> suspect                        Top/cscorfns.c:static  EVENT  *evtmp = NULL;
>>>>>>>>>> suspect                        Top/cscorfns.c:static  EVTBLK *evtmpblk;
>>>>>>>>>> suspect                        Top/cscorfns.c:static SPACE  spaceanchor = { { NULL, NULL, TYP_SPACE, 0 }, NULL };
>>>>>>>>>> suspect                        Top/cscorfns.c:static int    warpout = 0;
>>>>>>>>>> suspect                        Top/csound.c:static  volatile  int init_done = 0;
>>>>>>>>>> suspect                        Top/csound.c:static  volatile  csInstance_t  *instance_list = NULL;
>>>>>>>>>> suspect                        Top/csound.c:static  volatile  int exitNow_ = 0;
>>>>>>>>>> ??                             Top/csound.c:static double timeResolutionSeconds = -1.0;
>>>>>>>>>> ??                             interfaces/CsoundFile.cpp:char staticBuffer[0x1000];
>>>>>>>>>> ??                             interfaces/CsoundFile.cpp:  buffer = staticBuffer;
>>>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>>>> ??                             interfaces/Soundfile.hpp:  static double buffer[16];
>>>>>>>>>> ??                             interfaces/Soundfile.hpp:     * In Python this function is not thread-safe, as a static buffer is used internally.