[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (guix git) and guile-git finalizers.
From: |
Andy Wingo |
Subject: |
Re: (guix git) and guile-git finalizers. |
Date: |
Thu, 22 Jun 2017 13:40:06 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi :)
Just some code review.
On Mon 19 Jun 2017 18:01, Mathieu Othacehe <address@hidden> writes:
> The idea here is to create a guardian per pointer-type to finalize. A
> pumper function that operates on this guardian is also created. This
> pumper function knows the git_libgit2_xxx function to call to free the
> pointers stored in guardians.
Neat. A couple problems though.
(1) All finalizable objects will be kept alive until they are removed
from the guardian. With guardians, you usually want to incrementally
visit it during program execution: say, every time you allocate a new
repository object. Or via after-gc-hook.
(2) Whether an object is visible in the guardian is not a very
deterministic property. It won't be returned from a guardian until
all other references are gone, but there's no guarantee about when it
will be returned -- depends on GC and many other factors. So it's
possible that repository objects are still "alive" after you shut down
libgit.
Why do you feel the need to "shut down" libgit? Honestly I would punt.
Most other libraries aren't like that.
Andy