summaryrefslogtreecommitdiffstats
path: root/test/unit/prof_active.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-06-13 19:49:58 (GMT)
committerJason Evans <jasone@canonware.com>2017-06-13 19:51:09 (GMT)
commit5018fe3f0979b7f9db9930accdf7ee31071fd703 (patch)
tree894055b5ff4ccde3d9d782861d45af4664f12ad2 /test/unit/prof_active.c
parent04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5 (diff)
parentba29113e5a58caeb6b4a65b1db6d8efae79cae45 (diff)
downloadjemalloc-5.0.0.zip
jemalloc-5.0.0.tar.gz
jemalloc-5.0.0.tar.bz2
Merge branch 'dev'5.0.0
Diffstat (limited to 'test/unit/prof_active.c')
-rw-r--r--test/unit/prof_active.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/test/unit/prof_active.c b/test/unit/prof_active.c
index a906beb..850a24a 100644
--- a/test/unit/prof_active.c
+++ b/test/unit/prof_active.c
@@ -1,8 +1,7 @@
#include "test/jemalloc_test.h"
static void
-mallctl_bool_get(const char *name, bool expected, const char *func, int line)
-{
+mallctl_bool_get(const char *name, bool expected, const char *func, int line) {
bool old;
size_t sz;
@@ -15,8 +14,7 @@ mallctl_bool_get(const char *name, bool expected, const char *func, int line)
static void
mallctl_bool_set(const char *name, bool old_expected, bool val_new,
- const char *func, int line)
-{
+ const char *func, int line) {
bool old;
size_t sz;
@@ -31,50 +29,41 @@ mallctl_bool_set(const char *name, bool old_expected, bool val_new,
static void
mallctl_prof_active_get_impl(bool prof_active_old_expected, const char *func,
- int line)
-{
-
+ int line) {
mallctl_bool_get("prof.active", prof_active_old_expected, func, line);
}
-#define mallctl_prof_active_get(a) \
+#define mallctl_prof_active_get(a) \
mallctl_prof_active_get_impl(a, __func__, __LINE__)
static void
mallctl_prof_active_set_impl(bool prof_active_old_expected,
- bool prof_active_new, const char *func, int line)
-{
-
+ bool prof_active_new, const char *func, int line) {
mallctl_bool_set("prof.active", prof_active_old_expected,
prof_active_new, func, line);
}
-#define mallctl_prof_active_set(a, b) \
+#define mallctl_prof_active_set(a, b) \
mallctl_prof_active_set_impl(a, b, __func__, __LINE__)
static void
mallctl_thread_prof_active_get_impl(bool thread_prof_active_old_expected,
- const char *func, int line)
-{
-
+ const char *func, int line) {
mallctl_bool_get("thread.prof.active", thread_prof_active_old_expected,
func, line);
}
-#define mallctl_thread_prof_active_get(a) \
+#define mallctl_thread_prof_active_get(a) \
mallctl_thread_prof_active_get_impl(a, __func__, __LINE__)
static void
mallctl_thread_prof_active_set_impl(bool thread_prof_active_old_expected,
- bool thread_prof_active_new, const char *func, int line)
-{
-
+ bool thread_prof_active_new, const char *func, int line) {
mallctl_bool_set("thread.prof.active", thread_prof_active_old_expected,
thread_prof_active_new, func, line);
}
-#define mallctl_thread_prof_active_set(a, b) \
+#define mallctl_thread_prof_active_set(a, b) \
mallctl_thread_prof_active_set_impl(a, b, __func__, __LINE__)
static void
-prof_sampling_probe_impl(bool expect_sample, const char *func, int line)
-{
+prof_sampling_probe_impl(bool expect_sample, const char *func, int line) {
void *p;
size_t expected_backtraces = expect_sample ? 1 : 0;
@@ -86,12 +75,10 @@ prof_sampling_probe_impl(bool expect_sample, const char *func, int line)
"%s():%d: Unexpected backtrace count", func, line);
dallocx(p, 0);
}
-#define prof_sampling_probe(a) \
+#define prof_sampling_probe(a) \
prof_sampling_probe_impl(a, __func__, __LINE__)
-TEST_BEGIN(test_prof_active)
-{
-
+TEST_BEGIN(test_prof_active) {
test_skip_if(!config_prof);
mallctl_prof_active_get(true);
@@ -124,9 +111,7 @@ TEST_BEGIN(test_prof_active)
TEST_END
int
-main(void)
-{
-
- return (test(
- test_prof_active));
+main(void) {
+ return test_no_reentrancy(
+ test_prof_active);
}