summaryrefslogtreecommitdiff
path: root/libs/libmdbx/src/test/pcrf
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-02-04 12:35:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-02-04 12:35:50 +0300
commitfdd2e14a948e5dbbf764c8abcaf0e7043020d413 (patch)
treeeccb03686fc7a3889292a1bfecd66a9421c8100b /libs/libmdbx/src/test/pcrf
parent55d5829d59d29a477804a2e1bebfce9f95e4f223 (diff)
libmdbx: merge
Diffstat (limited to 'libs/libmdbx/src/test/pcrf')
-rw-r--r--libs/libmdbx/src/test/pcrf/pcrf_test.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/libs/libmdbx/src/test/pcrf/pcrf_test.c b/libs/libmdbx/src/test/pcrf/pcrf_test.c
index b16e79f8ee..2db58a023a 100644
--- a/libs/libmdbx/src/test/pcrf/pcrf_test.c
+++ b/libs/libmdbx/src/test/pcrf/pcrf_test.c
@@ -336,20 +336,22 @@ static void periodic_stat(void) {
prev_del_time = mdbx_del_time;
}
-// static void periodic_add_rec() {
-// for (int i = 0; i < 10240; i++) {
-// if (ids_count <= REC_COUNT) {
-// int64_t id = obj_id++;
-// create_record(id);
-// add_id_to_pool(id);
-// }
-// if (ids_count > REC_COUNT) {
-// int64_t id = get_id_from_pool();
-// delete_record(id);
-// }
-// }
-// periodic_stat();
-//}
+#if 0 /* unused */
+static void periodic_add_rec() {
+ for (int i = 0; i < 10240; i++) {
+ if (ids_count <= REC_COUNT) {
+ int64_t id = obj_id++;
+ create_record(id);
+ add_id_to_pool(id);
+ }
+ if (ids_count > REC_COUNT) {
+ int64_t id = get_id_from_pool();
+ delete_record(id);
+ }
+ }
+ periodic_stat();
+}
+#endif
int main(int argc, char **argv) {
(void)argc;
@@ -358,14 +360,12 @@ int main(int argc, char **argv) {
char filename[PATH_MAX];
int i;
- mkdir(opt_db_path, 0775);
-
strcpy(filename, opt_db_path);
- strcat(filename, "/mdbx.dat");
+ strcat(filename, MDBX_DATANAME);
remove(filename);
strcpy(filename, opt_db_path);
- strcat(filename, "/mdbx.lck");
+ strcat(filename, MDBX_LOCKNAME);
remove(filename);
puts("Open DB...");
@@ -394,14 +394,14 @@ int main(int argc, char **argv) {
id = get_id_from_pool();
delete_record(id);
}
- // for (i = 0; i < 50; i++) {
- // int64_t id = obj_id++;
- // create_record(id);
- // add_id_to_pool(id);
- // }
- // int64_t id = obj_id++;
- // create_record(id);
- // add_id_to_pool(id);
+ for (i = 0; i < 50; i++) {
+ int64_t id = obj_id++;
+ create_record(id);
+ add_id_to_pool(id);
+ }
+ int64_t id = obj_id++;
+ create_record(id);
+ add_id_to_pool(id);
int64_t now = getClockUs();
if ((now - t) > 10000000L) {
periodic_stat();