Re: Adding RB_NFIND() to sys/tree.h



Jason Evans wrote:

[This is a slightly edited copy of email originally sent to - current. The only response I received was that -arch is a better list on which to ask for feedback on this issue.]

I'd like to add RB_NFIND() to sys/tree.h, since I need it for the malloc implementation I've been working on. sys/tree.h comes from NetBSD, and up to now, the only changes we've made have been for the purpose of avoiding compiler warnings.

RB_NFIND() is like RB_FIND(), but if an exact match isn't found, RB_NFIND() returns the next object in the tree (if there is one). Emulating RB_NFIND() with the existing RB_*() API is possible, but certainly not ideal.

I would claim that RB_PFIND() isn't necessary, since it could be easily (if not quite as efficiently) emulated with RB_NFIND(), followed by RB_PREV(). However, there is no RB_PREV(), even though there is RB_NEXT(). This seems to me like an API design oversight (as is the omission of RB_FOREACH_REVERSE()), but it doesn't cause me issues, so I haven't tackled it.

A patch follows (manpage changes omitted). Are there any objections to committing this?

Thanks,
Jason


I see no reason to not add it.


_______________________________________________ freebsd-arch@xxxxxxxxxxx mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Adding RB_NFIND() to sys/tree.h
    ... The only response I received was that -arch is a better ... RB_NFINDis like RB_FIND, but if an exact match isn't found, RB_NFINDreturns the next object in the tree. ... Emulating RB_NFINDwith the existing RB_*API is possible, ... This seems to me like an API design oversight ), but it doesn't cause me issues, so I haven't tackled it. ...
    (freebsd-arch)
  • Adding RB_NFIND() to sys/tree.h
    ... I'd like to add RB_NFINDto sys/tree.h, since I need it for the malloc implementation I've been working on. ... Mark Murray suggested that I ask for comments here before committing. ... Emulating RB_NFINDwith the existing RB_*API is possible, ... This seems to me like an API design oversight ), but it doesn't cause me issues, so I haven't tackled it. ...
    (freebsd-current)
  • Re: USSTAB color question
    ... Edward's response was a bit ambiguous in his emphasis on the PLU. ... request and response is to establish just which of the enhancements are ... today's emulators don't restrict themselves just to emulating ... It is the availability of such USS messages - and the ...
    (bit.listserv.ibm-main)
  • Re: enabling certain services for only certain accounts
    ... Thanks for your response. ... Can you pass a user name and password, emulating a 'run as'? ... > net start dnscache ... > (example stops and starts the caching DNS resolver) ...
    (microsoft.public.windowsxp.security_admin)