Skip to content

Commit

Permalink
CI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Jul 26, 2023
1 parent b7ba610 commit 624f659
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/allocate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
// SPDX-License-Identifier: MIT

#include "allocate.h"

#include "core.h"

#include "box2d/api.h"

#if defined(_WIN32)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include <stdlib.h>
#else
#include <stdlib.h>
#endif

#include <stdint.h>
#include <stdatomic.h>
#include <stdint.h>

#ifdef BOX2D_PROFILE

Expand Down Expand Up @@ -50,7 +53,12 @@ void* b2Alloc(int32_t size)
return ptr;
}

#ifdef B2_PLATFORM_WINDOWS
void* ptr = _aligned_malloc(size, 16);
#else
void* ptr = aligned_alloc(16, size);
#endif

b2TracyCAlloc(ptr, size);
return ptr;
}
Expand All @@ -70,7 +78,11 @@ void b2Free(void* mem, int32_t size)
}
else
{
#ifdef B2_PLATFORM_WINDOWS
_aligned_free(mem);
#else
free(mem);
#endif
}

atomic_fetch_sub_explicit(&b2_byteCount, size, memory_order_relaxed);
Expand Down

0 comments on commit 624f659

Please sign in to comment.