Skip to content

Commit

Permalink
node-leak-test
Browse files Browse the repository at this point in the history
Signed-off-by: cqy123456 <[email protected]>
  • Loading branch information
cqy123456 committed Jan 4, 2024
1 parent 92c0aeb commit 88e9606
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/knowhere/factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ class IndexFactory {
};

#define KNOWHERE_CONCAT(x, y) index_factory_ref_##x##y
#define KNOWHERE_CREATE_FUN(x, y) index_node_create_##x##y
#define KNOWHERE_REGISTER_GLOBAL(name, func, data_type) \
const IndexFactory& KNOWHERE_CONCAT(name, data_type) = IndexFactory::Instance().Register<data_type>(#name, func)
#define KNOWHERE_SIMPLE_REGISTER_GLOBAL(name, index_node, data_type, ...) \
KNOWHERE_REGISTER_GLOBAL( \
name, \
[](const int32_t& version, const Object& object) { \
return (Index<index_node<data_type, ##__VA_ARGS__>>::Create(version, object)); \
}, \
data_type)
#define KNOWHERE_MOCK_REGISTER_GLOBAL(name, index_node, data_type, ...) \
#define KNOWHERE_SIMPLE_REGISTER_GLOBAL(name, index_node, data_type, ...) \
std::function<Index<IndexNode>(const int32_t& version, const Object&)> KNOWHERE_CREATE_FUN( \
name, data_type) = [](const int32_t& version, const Object& object) { \
return (Index<index_node<data_type, ##__VA_ARGS__>>::Create(version, object)); \
}; \
KNOWHERE_REGISTER_GLOBAL(name, KNOWHERE_CREATE_FUN(name, data_type), data_type)
#define KNOWHERE_MOCK_REGISTER_GLOBAL(name, indesx_node, data_type, ...) \
KNOWHERE_REGISTER_GLOBAL( \
name, \
[](const int32_t& version, const Object& object) { \
Expand Down

0 comments on commit 88e9606

Please sign in to comment.