fix memory leak and add framework test

This commit is contained in:
liuwentan
2022-11-29 14:12:40 +08:00
parent 7e6d131c9e
commit 84a271144b
19 changed files with 321 additions and 56 deletions

View File

@@ -56,14 +56,15 @@ int table_runtime_scan_stream(struct table_runtime *table_rt, const char *data,
int result[], size_t n_result);
void table_runtime_stream_close(struct table_runtime *table_rt);
/* plugin table runtime API */
size_t plugin_table_runtime_cached_row_count(struct table_runtime *table_rt);
/* table runtime cached row API */
size_t table_runtime_cached_row_count(struct table_runtime *table_rt);
const char* plugin_table_runtime_get_cached_row(struct table_runtime *table_rt, size_t row_seq);
const char* table_runtime_get_cached_row(struct table_runtime *table_rt, size_t row_seq);
void *plugin_table_runtime_get_ex_data(struct table_runtime *table_rt, struct table_schema *table_schema, const char *key, size_t key_len);
/* table runtime ex data API */
void *table_runtime_get_ex_data(struct table_runtime *table_rt, struct table_schema *table_schema, const char *key, size_t key_len);
void plugin_table_runtime_commit_ex_data_schema(struct table_runtime *table_rt, struct table_schema *table_schema);
void table_runtime_commit_ex_data_schema(struct table_runtime *table_rt, struct table_schema *table_schema);
#ifdef __cpluscplus
}

View File

@@ -21,8 +21,9 @@ extern "C"
#include "maat/maat.h"
#include "adapter_hs.h"
#define MAX_TABLE_NUM 256
#define MAX_DISTRICT_STR 128
#define MAX_IP_STR 128
#define MAX_IP_STR 128
#define MAX_KEYWORDS_STR 1024
enum table_type {
@@ -35,10 +36,9 @@ enum table_type {
};
enum expr_type {
EXPR_TYPE_STRING = 1,
EXPR_TYPE_REGEX,
EXPR_TYPE_STRING = 0,
EXPR_TYPE_AND,
EXPR_TYPE_OFFSET,
EXPR_TYPE_REGEX,
EXPR_TYPE_MAX
};

View File

@@ -42,6 +42,9 @@ char *str_unescape_and(char *s);
char *str_unescape(char *s);
/* system cmd wrapper */
int system_cmd_mkdir(const char* path);
#ifdef __cpluscplus
}
#endif

View File

@@ -1,7 +1,7 @@
/*
**********************************************************************************************
* File: maat_rhash.h
* Description: maat rcu hashtable
* File: rcu_hash.h
* Description: rcu hashtable
* Authors: Liu WenTan <liuwentan@geedgenetworks.com>
* Date: 2022-10-31
* Copyright: (c) 2018-2022 Geedge Networks, Inc. All rights reserved.