On Fri Mar 1 13:46:47 2024 +0000, Jinoh Kang wrote:
I didn't see why this would be necessary as the mapping is created
during server init as a permanent object. Not a bug, but conceptually confusing. Thanks anyway :3
There are other cases like that, such as the root directory,
`root_directory` assignment is in the caller side of `create_directory`; the function itself doesn't keep a reference. Meanwhile we both assign the pointer *and* return the pointer, hence two references. If we want to go `root_directory` way, it should have been:
session_mapping = create_session_mapping( ... );
the user shared mapping
In this case, we only store the `mmap` address (which is managed independently), not the object pointer itself. So I don't think this is applicable as a precedent either.
I changed this to add a separate set_session_mapping, though I don't think it changes much. I'm still not keeping a reference because it messes up with the leak checker which reports a leaked reference.