This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [V2 patch] Enhance comments in nsswitch.h


On 5/16/19 4:27 PM, DJ Delorie wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>> I think we should not add comments which are misleading in the context
>> of the current implementation.
> 
> My initial plan wasn't to commit this at all, but to use it as a
> discussion of how to refactor it all ;-)
> 

I think it can be both.

As a first pass you looked at which objects can be unloaded.

Florian and I discussed this further in private and the consensus
that emerged was that the following information could serve dual
purpose:

* Allocation ownership:
  - Who is allowed to allocate the object.
  - Who is allowed to deallocate the object.

* Usage pattern:
  - How does the ownership of the pointer get passed around
    the framework?

That is if instead of loading/unloading we focused on documenting
who owns the allocation and who can free it and the usage patterns,
that would actually highlight exactly where and which structures
can be unloaded. Since for example if you own the object and can
free it, then that's the only point where you could unload related
data.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]