On Sat, Oct 30, 2021 at 3:06 PM Sergey Bugaev <buga...@gmail.com> wrote:
> But
> memory_object_create_proxy () does add a reference to the memory
> object by doing ipc_port_copy_send (object[0]). It would seem that it
> should not do that; but then I'm not sure why this doesn't cause a
> leak — I know Samuel has ensured that proxies don't cause leaks, at
> least not immediately visible ones.

Aha, that is the exact thing that Samuel has fixed here [0] (and has
mentioned to me at the time).

[0]: 
https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/vm/memory_object_proxy.c?id=5179bcf28dac3fb39d7d4949964f038fe697bf4e

I was just testing the new version, but looking at the old version of
the source code in my local checkout. Sorry for any confusion that
I've caused by not adding 2 and 2 together.

So yes, you want to take a reference to the pager port while still
holding the lock, and then pass it over to the proxy, which takes
ownership of the port if it returns success — but if it doesn't, you
have to release the reference!

Sergey

Reply via email to