Skip to content

Commit 604a4fe

Browse files
committed
remove CTL_LEAF_SUBTREE2
It was never really needed, as name conflict can be handled it with __VA_ARGS__ parameter but now as by_handle handlers are in two separete files we do not have a conflict at all.
1 parent 145b933 commit 604a4fe

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/ctl/ctl_internal.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,6 @@ umf_result_t ctl_query(struct ctl *ctl, void *ctx,
225225
NULL \
226226
}
227227

228-
#define CTL_LEAF_SUBTREE2(name, fun, ...) \
229-
{ \
230-
CTL_STR(name), CTL_NODE_SUBTREE, \
231-
{NULL, NULL, NULL, CTL_SUBTREE_HANDLER(fun, __VA_ARGS__)}, NULL, \
232-
NULL \
233-
}
234-
235228
/*
236229
* Declaration of a new read-write leaf. If used both read and write function
237230
* must be declared by CTL_READ_HANDLER and CTL_WRITE_HANDLER macros.

src/memory_pool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static struct ctl umf_pool_ctl_root;
3737

3838
static void ctl_init(void);
3939

40-
static umf_result_t CTL_SUBTREE_HANDLER(by_handle_pool)(
40+
static umf_result_t CTL_SUBTREE_HANDLER(by_handle)(
4141
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
4242
umf_ctl_index_utlist_t *indexes, const char *extra_name,
4343
umf_ctl_query_type_t queryType) {
@@ -121,7 +121,7 @@ static umf_result_t CTL_READ_HANDLER(alloc_count)(
121121
static const umf_ctl_node_t CTL_NODE(stats)[] = {CTL_LEAF_RO(alloc_count),
122122
CTL_NODE_END};
123123

124-
umf_ctl_node_t CTL_NODE(pool)[] = {CTL_LEAF_SUBTREE2(by_handle, by_handle_pool),
124+
umf_ctl_node_t CTL_NODE(pool)[] = {CTL_LEAF_SUBTREE(by_handle),
125125
CTL_LEAF_SUBTREE(default), CTL_NODE_END};
126126

127127
static void ctl_init(void) {

src/memory_provider.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "memory_provider_internal.h"
2222
#include "utils_assert.h"
2323

24-
static umf_result_t CTL_SUBTREE_HANDLER(by_handle_provider)(
24+
static umf_result_t CTL_SUBTREE_HANDLER(by_handle)(
2525
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
2626
umf_ctl_index_utlist_t *indexes, const char *extra_name,
2727
umf_ctl_query_type_t queryType) {
@@ -32,8 +32,8 @@ static umf_result_t CTL_SUBTREE_HANDLER(by_handle_provider)(
3232
return UMF_RESULT_SUCCESS;
3333
}
3434

35-
umf_ctl_node_t CTL_NODE(provider)[] = {
36-
CTL_LEAF_SUBTREE2(by_handle, by_handle_provider), CTL_NODE_END};
35+
umf_ctl_node_t CTL_NODE(provider)[] = {CTL_LEAF_SUBTREE(by_handle),
36+
CTL_NODE_END};
3737

3838
static umf_result_t umfDefaultPurgeLazy(void *provider, void *ptr,
3939
size_t size) {

0 commit comments

Comments
 (0)