public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Santos <danielfsantos@att.net>
To: linux-kernel@vger.kernel.org
Subject: Generic Red-Black Trees (status update)
Date: Fri, 25 May 2012 17:48:48 -0500	[thread overview]
Message-ID: <4FC00C50.3000907@att.net> (raw)

For anybody that's keeping up with this, I've gone through multiple
iterations and tests with 9 different gcc versions and concluded that
the search, insert & remove cores need to be coded in rbtree.h, using
the traditional interface (i.e., passing struct rb_node & rb_root
pointers instead of pointers to your specific object types).  The reason
is that gcc can't handle the cool fully-generic code until 4.6.  In gcc
4.5.x, optimization completely breaks expanding the inline functions
into huge bloated  monsters.  Also, while I'm re-coding it all, I'm
adding find_near & insert_near, for more efficient insertion & retrieval
when you already have a node that should be close to the one you want
(which is often the case when inserting many objects at once).

So after I'm done with this, I'll start on a new header file (grbtree.h
probably) using the "grb_" prefix for it's functions that implements the
gcc 4.6.x+ fully generic & type safe interface, but using cute
pre-processor tricks for pre-4.6.x compatibility (basically, something
to consider using once gcc 4.6+ is more widely used).

Daniel

             reply	other threads:[~2012-05-25 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 22:48 Daniel Santos [this message]
2012-05-25 23:02 ` Generic Red-Black Trees (status update) Andi Kleen
2012-05-26  1:12   ` Daniel Santos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC00C50.3000907@att.net \
    --to=danielfsantos@att.net \
    --cc=daniel.santos@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox