several fixes (#112)

* updated fmt

* submodules updated

* fixed _TIMESPEC_DEFINED for winpthreads under windows

* fixed sdl3 under qt

* virtual_memory: Ensure mapped addresses stay inside the user area

* Fixes LLE Libc crashing on linux

---------

Co-authored-by: GPUCode <geoster3d@gmail.com>
This commit is contained in:
georgemoralis 2024-04-13 22:37:21 +03:00 committed by GitHub
parent 5ed4891a1f
commit e99129d72f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 20 additions and 26 deletions

View file

@ -2,7 +2,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define _TIMESPEC_DEFINED
#include <pthread.h>
#include "common/types.h"

View file

@ -2,7 +2,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define _TIMESPEC_DEFINED
#include <atomic>
#include <mutex>

View file

@ -170,7 +170,8 @@ u64 memory_alloc_aligned(u64 address, u64 size, MemoryMode mode, u64 alignment)
}
return ptr;
#else
void* hint_address = reinterpret_cast<void*>(AlignUp(address, alignment));
void* hint_address = address == 0 ? reinterpret_cast<void*>(USER_MIN)
: reinterpret_cast<void*>(AlignUp(address, alignment));
void* ptr = mmap(hint_address, size, convertMemoryMode(mode), MAP_ANON | MAP_PRIVATE, -1, 0);
ASSERT(ptr != MAP_FAILED);
return reinterpret_cast<u64>(ptr);