Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 18:48 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 15:52 [+0100]: > > Am Freitag, dem 19.11.2021 um 14:14 + schrieb Maxime Devos: > > > [...] > > > > > > From your other responses, I now know it is actually related to > > > (non- > > >

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 15:52 [+0100]: > Am Freitag, dem 19.11.2021 um 14:14 + schrieb Maxime Devos: > > [...] > > > > From your other responses, I now know it is actually related to > > (non- > > )Java style finalisation, but my comment about ‘separate patch’ > > still > >

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 14:21 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:35 [+0100]: > > Am Freitag, dem 19.11.2021 um 13:15 + schrieb Maxime Devos: > > > Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > > > > +  SCM *smobs = scm_gc_malloc

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 14:14 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:55 [+0100]: > > Am Freitag, dem 19.11.2021 um 13:48 + schrieb Maxime Devos: > > > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > > > -  rx =

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 14:35 [+0100]: > Am Freitag, dem 19.11.2021 um 13:15 + schrieb Maxime Devos: > > Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > > > +  SCM *smobs = scm_gc_malloc (sizeof(SCM) * SMOBS_COUNT, > > > "smobs"); > > > + > > >    int i; > > >   

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 14:55 [+0100]: > Am Freitag, dem 19.11.2021 um 13:48 + schrieb Maxime Devos: > > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > > -  rx = scm_gc_malloc_pointerless (sizeof (regex_t), > > > > > "regex"); > > > > > +  rx = scm_malloc

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 13:48 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > -  rx = scm_gc_malloc_pointerless (sizeof (regex_t), "regex"); > > > > +  rx = scm_malloc (sizeof (regex_t)); > > > > > > If the regex why scm_gc_malloc_pointerless

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 14:53 [+0100]: > [...] > The straight-forward solution is to statically tie the lifetime of > regex_t to that of the smob. Which we cannot do with GC, but simply > with malloc+free - as implemented in the patch. OK, but for clarity I recommend adding a

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Maxime Devos schreef op vr 19-11-2021 om 13:44 [+]: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:40 [+0100]: > > Am Freitag, dem 19.11.2021 um 13:35 + schrieb Maxime Devos: > > > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > > You coud simply ... > > > > > > > > > >

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 13:44 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:40 [+0100]: > > Am Freitag, dem 19.11.2021 um 13:35 + schrieb Maxime Devos: > > > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > > You coud simply ... > > > > > >

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > -  rx = scm_gc_malloc_pointerless (sizeof (regex_t), "regex"); > > > +  rx = scm_malloc (sizeof (regex_t)); > > > > If the regex why scm_gc_malloc_pointerless -> scm_malloc? > > Is rx not pointerless? > > Not sure I understand the

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 14:40 [+0100]: > Am Freitag, dem 19.11.2021 um 13:35 + schrieb Maxime Devos: > > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > > You coud simply ... > > > > > > > > > > > > > -  scm_gc_free (rx, sizeof(regex_t), "regex"); > > >

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 13:17 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > > +  /* For guardians, we use unordered finalization `a la Java. */ > > Maybe add the reasons why this is only done when a guardian is created? > E.g., > > /* Don't use

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > You coud simply ... > > > > > > > -  scm_gc_free (rx, sizeof(regex_t), "regex"); > > > +  free (rx); > > > > drop the scm_gc_free AFAIK. > > No, I cannot as explained in the patch summary: If we use scm_gc_free > in a free

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 13:35 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op vr 19-11-2021 om 14:32 [+0100]: > > > You coud simply ... > > > > > > > > > > -  scm_gc_free (rx, sizeof(regex_t), "regex"); > > > > +  free (rx); > > > > > > drop the scm_gc_free AFAIK. > > > >

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 13:15 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > > +  SCM *smobs = scm_gc_malloc (sizeof(SCM) * SMOBS_COUNT, "smobs"); > > + > >    int i; > >    mark_call_count = 0; > >    for (i = 0; i < SMOBS_COUNT; i++) > > -   

Re: GC + Java finalization

2021-11-19 Thread Developers list for Guile, the GNU extensibility library
Am Freitag, dem 19.11.2021 um 13:13 + schrieb Maxime Devos: > Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > > From 33af6a98c6801e7b4880d1d3f78f7e2097c2174e Mon Sep 17 00:00:00 > > 2001 > > From: Jonas Hahnfeld > > Date: Fri, 2 Jul 2021 23:03:17 +0200 > > Subject: [PATCH 2/3]

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > +  /* For guardians, we use unordered finalization `a la Java. */ Maybe add the reasons why this is only done when a guardian is created? E.g., /* Don't use unordered finalization when not using guardians,     because Java finalization

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > +  SCM *smobs = scm_gc_malloc (sizeof(SCM) * SMOBS_COUNT, "smobs"); > + >    int i; >    mark_call_count = 0; >    for (i = 0; i < SMOBS_COUNT; i++) > -    make_x (); > +    smobs[i] = make_x (); >    scm_gc (); smobs doesn't need to be

Re: GC + Java finalization

2021-11-19 Thread Maxime Devos
Jonas Hahnfeld schreef op do 15-07-2021 om 20:44 [+0200]: > From 33af6a98c6801e7b4880d1d3f78f7e2097c2174e Mon Sep 17 00:00:00 > 2001 > From: Jonas Hahnfeld > Date: Fri, 2 Jul 2021 23:03:17 +0200 > Subject: [PATCH 2/3] Avoid matching calls of scm_gc_free > > There is no point in registering