mdbx-test: minor cleanup pcrf-test/example.

Change-Id: Ie4d56592c8dd561d49ca423c2a8ac653a9e853ee
This commit is contained in:
Leonid Yuriev 2020-02-01 20:43:18 +03:00
parent fb1d600597
commit aeda2aa8c5

View File

@ -336,20 +336,22 @@ static void periodic_stat(void) {
prev_del_time = mdbx_del_time; prev_del_time = mdbx_del_time;
} }
// static void periodic_add_rec() { #if 0 /* unused */
// for (int i = 0; i < 10240; i++) { static void periodic_add_rec() {
// if (ids_count <= REC_COUNT) { for (int i = 0; i < 10240; i++) {
// int64_t id = obj_id++; if (ids_count <= REC_COUNT) {
// create_record(id); int64_t id = obj_id++;
// add_id_to_pool(id); create_record(id);
// } add_id_to_pool(id);
// if (ids_count > REC_COUNT) { }
// int64_t id = get_id_from_pool(); if (ids_count > REC_COUNT) {
// delete_record(id); int64_t id = get_id_from_pool();
// } delete_record(id);
// } }
// periodic_stat(); }
//} periodic_stat();
}
#endif
int main(int argc, char **argv) { int main(int argc, char **argv) {
(void)argc; (void)argc;
@ -358,14 +360,12 @@ int main(int argc, char **argv) {
char filename[PATH_MAX]; char filename[PATH_MAX];
int i; int i;
mkdir(opt_db_path, 0775);
strcpy(filename, opt_db_path); strcpy(filename, opt_db_path);
strcat(filename, "/mdbx.dat"); strcat(filename, MDBX_DATANAME);
remove(filename); remove(filename);
strcpy(filename, opt_db_path); strcpy(filename, opt_db_path);
strcat(filename, "/mdbx.lck"); strcat(filename, MDBX_LOCKNAME);
remove(filename); remove(filename);
puts("Open DB..."); puts("Open DB...");
@ -394,14 +394,14 @@ int main(int argc, char **argv) {
id = get_id_from_pool(); id = get_id_from_pool();
delete_record(id); delete_record(id);
} }
// for (i = 0; i < 50; i++) { for (i = 0; i < 50; i++) {
// int64_t id = obj_id++; int64_t id = obj_id++;
// create_record(id); create_record(id);
// add_id_to_pool(id); add_id_to_pool(id);
// } }
// int64_t id = obj_id++; int64_t id = obj_id++;
// create_record(id); create_record(id);
// add_id_to_pool(id); add_id_to_pool(id);
int64_t now = getClockUs(); int64_t now = getClockUs();
if ((now - t) > 10000000L) { if ((now - t) > 10000000L) {
periodic_stat(); periodic_stat();