Skip to content

Commit

Permalink
feat bfdev: update version
Browse files Browse the repository at this point in the history
Signed-off-by: John Sanpe <[email protected]>
  • Loading branch information
sanpeqf committed Jan 5, 2024
1 parent aae0a6b commit 6c9b7d2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bfdev
Submodule bfdev updated 273 files
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright(c) 2023 John Sanpe <[email protected]>
#

options+=" -DHOST_C_COMPILER=/bin/gcc"
options+=" -DENABLE_EXAMPLES=ON"
options+=" --toolchain cmake/toolchain.cmake"

cmake -Bbuild $options
cmake --build build -j$(nproc)
6 changes: 4 additions & 2 deletions examples/benchmark/rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ struct bench_node {
#define rb_to_bench(ptr) \
bfdev_rb_entry_safe(ptr, struct bench_node, node)

static long demo_cmp(const struct bfdev_rb_node *a, const struct bfdev_rb_node *b)
static long
demo_cmp(const struct bfdev_rb_node *a,
const struct bfdev_rb_node *b, void *pdata)
{
struct bench_node *demo_a = rb_to_bench(a);
struct bench_node *demo_b = rb_to_bench(b);
Expand Down Expand Up @@ -51,7 +53,7 @@ int benchmark(void)

for (loop = 0; loop < TEST_LOOP; ++loop) {
for (count = 0; count < TEST_LEN; ++count)
bfdev_rb_insert(&bench_root, &node[count].node, demo_cmp);
bfdev_rb_insert(&bench_root, &node[count].node, demo_cmp, NULL);
bench_root = BFDEV_RB_INIT;
}

Expand Down

0 comments on commit 6c9b7d2

Please sign in to comment.