Rewrite red-black trees.

Use left-leaning 2-3 red-black trees instead of left-leaning 2-3-4
red-black trees.  This reduces maximum tree height from (3 lg n) to
(2 lg n).

Do lazy balance fixup, rather than transforming the tree during the down
pass.  This improves insert/remove speed by ~30%.

Use callback-based iteration rather than macros.
This commit is contained in:
Jason Evans
2010-02-28 15:00:18 -08:00
parent fbb504def6
commit f3ff75289b
4 changed files with 892 additions and 853 deletions

View File

@@ -31,6 +31,7 @@
#include <dlfcn.h>
#endif
#define RB_COMPACT
#include "jemalloc/internal/rb.h"
#include "jemalloc/internal/qr.h"
#include "jemalloc/internal/ql.h"

File diff suppressed because it is too large Load Diff