From 6c9b7d284a7c9bf06c5ad4a506656bdec1b18f0f Mon Sep 17 00:00:00 2001 From: John Sanpe Date: Fri, 5 Jan 2024 13:49:19 +0800 Subject: [PATCH] feat bfdev: update version Signed-off-by: John Sanpe --- bfdev | 2 +- build.sh | 11 +++++++++++ examples/benchmark/rbtree.c | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 build.sh diff --git a/bfdev b/bfdev index b773a7f..b8f97df 160000 --- a/bfdev +++ b/bfdev @@ -1 +1 @@ -Subproject commit b773a7f2c0df74bdf440f04594c5f9218aeccfc0 +Subproject commit b8f97df312255df7a171bfa0a735e59f8b0a6aff diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..b4de2b3 --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright(c) 2023 John Sanpe +# + +options+=" -DHOST_C_COMPILER=/bin/gcc" +options+=" -DENABLE_EXAMPLES=ON" +options+=" --toolchain cmake/toolchain.cmake" + +cmake -Bbuild $options +cmake --build build -j$(nproc) diff --git a/examples/benchmark/rbtree.c b/examples/benchmark/rbtree.c index a5452e5..e6daf83 100755 --- a/examples/benchmark/rbtree.c +++ b/examples/benchmark/rbtree.c @@ -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); @@ -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; }