Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fbsd fix attempt2 #218

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,10 @@ endif

ifeq ($(UNAME), FreeBSD)
STRIP = strip -s $(BUILD_DIR)/$(LIBNAME)
## Using spinlocks to avoid recursive locks contentions with calloc
USE_SPINLOCK = -DUSE_SPINLOCK=1
## Once FreeBSD 13.1 becomes the minimal non EOL version
## it can be enabled
## SCHED_GETCPU = -DSCHED_GETCPU
# The unit tests fail when thread support is enabled on this platform
# causing zones size mismatches
THREAD_SUPPORT = -DTHREAD_SUPPORT=0
SCHED_GETCPU = -DSCHED_GETCPU
endif

ifeq ($(UNAME), DragonFly)
Expand Down
1 change: 1 addition & 0 deletions tests/big_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "iso_alloc.h"
#include "iso_alloc_internal.h"
#include <time.h>

int main(int argc, char *argv[]) {

Expand Down
4 changes: 4 additions & 0 deletions tests/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

#include <memory>
#include <array>
#if THREAD_SUPPORT
#include <thread>
#endif
#include "iso_alloc.h"
#include "iso_alloc_internal.h"

Expand Down Expand Up @@ -119,13 +121,15 @@ int main(int argc, char *argv[]) {
Derived::operator delete(d, ptr);
}

#if THREAD_SUPPORT
for(size_t i = 0; i < 4; i++) {
std::array<std::thread, 4> t;
for(size_t z = 0; z < 4; z++) {
t[i] = std::thread(allocate, array_sizes[i], allocation_sizes[z]);
t[i].join();
}
}
#endif

iso_verify_zones();

Expand Down
Loading