salad: make heap struct more friendly to use
Now heap API works with struct heap_node only, which forces a user to constantly call container_of. Such a code looks really awful. This commit makes heap taking and returning user defined structures, and removes container_of clue. It is worth noting, that the similar API rb-tree and b-tree have. Even rlist has its rlist_*_entry() wrappers, and mhash provides macroses to define your own value type.
Showing
- src/box/vy_lsm.c 4 additions, 5 deletionssrc/box/vy_lsm.c
- src/box/vy_range.h 3 additions, 3 deletionssrc/box/vy_range.h
- src/box/vy_scheduler.c 24 additions, 43 deletionssrc/box/vy_scheduler.c
- src/box/vy_write_iterator.c 21 additions, 28 deletionssrc/box/vy_write_iterator.c
- src/lib/salad/heap.h 72 additions, 43 deletionssrc/lib/salad/heap.h
- test/unit/heap.c 31 additions, 45 deletionstest/unit/heap.c
- test/unit/heap_iterator.c 25 additions, 42 deletionstest/unit/heap_iterator.c
Loading
Please register or sign in to comment