Skip to content
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
5 changes: 5 additions & 0 deletions crnlib/crn_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ static void* crnlib_default_realloc(void* p, size_t size, size_t* pActual_size,
void* p_new;

if (!p) {
#if defined(__FreeBSD__)
// See https://github.com/DaemonEngine/crunch/pull/36
p_new = ::aligned_alloc(CRNLIB_MIN_ALLOC_ALIGNMENT, size);
#else
p_new = ::malloc(size);
#endif
CRNLIB_ASSERT((reinterpret_cast<ptr_bits_t>(p_new) & (CRNLIB_MIN_ALLOC_ALIGNMENT - 1)) == 0);

if (!p_new) {
Expand Down
5 changes: 5 additions & 0 deletions inc/crn_decomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,12 @@ static void* crnd_default_realloc(void* p, size_t size, size_t* pActual_size, bo
void* p_new;

if (!p) {
#if defined(__FreeBSD__)
// See https://github.com/DaemonEngine/crunch/pull/36
p_new = ::aligned_alloc(CRNLIB_MIN_ALLOC_ALIGNMENT, size);
#else
p_new = ::malloc(size);
#endif

if (pActual_size) {
#ifdef WIN32
Expand Down