[Csnd-dev] memory issue with chnget...
Date | 2017-06-06 11:32 |
From | Rory Walsh |
Subject | [Csnd-dev] memory issue with chnget... |
If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this?
|
Date | 2017-06-06 11:34 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] memory issue with chnget... |
Attachments | chnget.csd exampleChngetEmpty.cpp |
Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there? On 6 June 2017 at 11:32, Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2017-06-06 11:58 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] memory issue with chnget... |
Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code. In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather than a leak? ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 6 Jun 2017, at 11:34, Rory Walsh |
Date | 2017-06-06 14:50 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] memory issue with chnget... |
Yeah I meant csound->GetChannel(""), which in turn calls csoundGetChannelPtr(). (I try to quote the C functions for John, it tends to get his attention quicker!) And yes, "unwanted memory growth" is perhaps a better term. On 6 June 2017 at 11:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code. |
Date | 2017-06-06 14:58 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] memory issue with chnget... |
I can add a check for an empty string if that helps. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 6 Jun 2017, at 14:50, Rory Walsh |
Date | 2017-06-06 15:14 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] memory issue with chnget... |
That should do the trick. Go raibh maith agat ;) On 6 June 2017 at 14:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: I can add a check for an empty string if that helps. |
Date | 2017-06-06 15:39 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] memory issue with chnget... |
Níl a bhuíochas ort. It’s in git develop now. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 6 Jun 2017, at 15:14, Rory Walsh |
Date | 2017-06-06 15:50 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] memory issue with chnget... |
All good now. Cheers. On 6 June 2017 at 15:39, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: Níl a bhuíochas ort. It’s in git develop now. |