[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts
From: |
R. Mattes |
Subject: |
Re: [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts |
Date: |
Wed, 11 May 2011 17:59:18 +0200 |
On Wed, 11 May 2011 16:00:57 +0100, Richard Shann wrote
> In practice this just means removing all the scm_dynwind stuff that you
> did, as we don't do any non-local jumps from scheme.
Here I disagree - you cannot predict what user-provided scheme code
might do. And scheme code might always throw an uncought
exception. This would lead to leaking memory.
> Instead free
> any C strings created with scm_to_locale_string() using free() (not
> g_free()).
Yes, even so g_free might be just a call to free, on some platforms memory
must be freed by the same allocator library as the one that created it.
> More importantly the scm_take_from... need to revert to scm_from...
> in all cases. In the cases where the string being passed is freshly
> allocated (ie g_malloc'd) then call g_free() on it having created
> the scm_from... SCM structure.
And dont' forget to register it with the dynamic context! ;-)
> We can't exploit scm_take_from... (as
> I previously suggested) because it calls free() and glib is using
> its own memory allocator (so g_free() doesn't call free()). (So,
> another wild goose chase started by me I'm afraid :(
Ah, good to know. Anyway, looking at scm_take_from... in Guile 2 there will
be no benefit performance-wise anyway.
> It is only not crashing at the moment, because it seems scheme is not
> collecting its garbage...
Have you tested with manual gc?
Cheers, RalfD
- Re: [Denemo-devel] Midi shortcuts, (continued)
- Re: [Denemo-devel] Midi shortcuts, Richard Shann, 2011/05/10
- Re: [Denemo-devel] Midi shortcuts, Richard Shann, 2011/05/10
- Re: [Denemo-devel] Midi shortcuts, Richard Shann, 2011/05/10
- Re: [Denemo-devel] Midi shortcuts, R. Mattes, 2011/05/10
- Re: [Denemo-devel] Midi shortcuts, Richard Shann, 2011/05/11
- Re: [Denemo-devel] Midi shortcuts, R. Mattes, 2011/05/11
- Re: [Denemo-devel] Midi shortcuts, Richard Shann, 2011/05/11
- Re: [Denemo-devel] Midi shortcuts, Jeremiah Benham, 2011/05/11
- [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts, R. Mattes, 2011/05/11
- Re: [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts, Richard Shann, 2011/05/11
- Re: [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts,
R. Mattes <=
- Re: [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts, Richard Shann, 2011/05/11
- Re: [Denemo-devel] scm_dynwinds etc. [was:] Midi shortcuts, R. Mattes, 2011/05/11
- [Denemo-devel] Patchset: denemo-specific guile load path, R. Mattes, 2011/05/14
- Re: [Denemo-devel] Patchset: denemo-specific guile load path, Richard Shann, 2011/05/15
- Re: [Denemo-devel] Patchset: denemo-specific guile load path, R. Mattes, 2011/05/15
- Re: [Denemo-devel] Patchset: denemo-specific guile load path, Richard Shann, 2011/05/15
- Re: [Denemo-devel] Patchset: denemo-specific guile load path, Richard Shann, 2011/05/17
- Re: [Denemo-devel] Patchset: denemo-specific guile load path, Richard Shann, 2011/05/18
- Re: [Denemo-devel] Midi shortcuts, Nils Gey, 2011/05/07