summaryrefslogtreecommitdiffstats
path: root/deps/jemalloc/test/unit/spin.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/jemalloc/test/unit/spin.c')
-rw-r--r--deps/jemalloc/test/unit/spin.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/deps/jemalloc/test/unit/spin.c b/deps/jemalloc/test/unit/spin.c
new file mode 100644
index 0000000..b965f74
--- /dev/null
+++ b/deps/jemalloc/test/unit/spin.c
@@ -0,0 +1,18 @@
+#include "test/jemalloc_test.h"
+
+#include "jemalloc/internal/spin.h"
+
+TEST_BEGIN(test_spin) {
+ spin_t spinner = SPIN_INITIALIZER;
+
+ for (unsigned i = 0; i < 100; i++) {
+ spin_adaptive(&spinner);
+ }
+}
+TEST_END
+
+int
+main(void) {
+ return test(
+ test_spin);
+}