2017-02-09 02:30:44 +08:00
|
|
|
#include "test/jemalloc_test.h"
|
|
|
|
|
2017-05-24 05:26:31 +08:00
|
|
|
#include "jemalloc/internal/spin.h"
|
|
|
|
|
2017-02-09 02:30:44 +08:00
|
|
|
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);
|
|
|
|
}
|