force inline do_mmap_with_hooks

Otherwise mmap calling to do_mmap_with_hooks might tail-call (instead
of inlining), which will then break GetCallerStackTrace
facility (since only mmap is placed into special malloc_hook section).

This unbreaks heap checker on gcc 5, but is in general right thing to
do.
This commit is contained in:
Aliaksey Kandratsenka 2023-09-27 21:37:30 -04:00
parent 9a123db7b4
commit d48bf6b3ad

View File

@ -223,7 +223,8 @@ static void* do_mmap(void* start, size_t length, int prot, int flags, int fd, in
#ifdef DEFINED_DO_MMAP
static void* do_mmap_with_hooks(void* start, size_t length, int prot, int flags, int fd, int64_t offset) {
static inline ATTRIBUTE_ALWAYS_INLINE
void* do_mmap_with_hooks(void* start, size_t length, int prot, int flags, int fd, int64_t offset) {
void* result = do_mmap(start, length, prot, flags, fd, offset);
if (result == MAP_FAILED) {
return result;