+2025-09-13 Bruno Haible <bruno@clisp.org>
+
+ pagealign_alloc: Fix crashes (regression 2025-09-11).
+ * lib/pagealign_alloc.c (pagealign_alloc, pagealign_free): Add missing
+ 'break' statements. For PA_IMPL_VIRTUAL_ALLOC, don't use new_memnode and
+ get_memnode.
+
2025-09-13 Paul Eggert <eggert@cs.ucla.edu>
endian: port to Solaris 11.4 and macOS 15
For each memory region, we store the original pointer returned by
malloc(). */
void *pointer;
- /* For PA_IMPL_MMAP, PA_IMPL_VIRTUAL_ALLOC:
+ /* For PA_IMPL_MMAP:
For each memory region, we store its size. */
size_t size;
} info_t;
errno = ENOMEM;
return NULL;
}
- info_t info;
- info.size = size;
- new_memnode (ret, info);
+ break;
#else
errno = ENOSYS;
return NULL;
#if HAVE_SYS_MMAN_H
if (munmap (aligned_ptr, get_memnode (aligned_ptr).size) < 0)
error (EXIT_FAILURE, errno, "Failed to unmap memory");
+ break;
#else
abort ();
#endif
case PA_IMPL_POSIX_MEMALIGN:
#if HAVE_POSIX_MEMALIGN
free (aligned_ptr);
+ break;
#else
abort ();
#endif
/* Documentation:
<https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-free> */
_aligned_free (aligned_ptr);
+ break;
#else
abort ();
#endif
#if defined _WIN32 && !defined __CYGWIN__
/* Documentation:
<https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualfree> */
- if (!VirtualFree (aligned_ptr, get_memnode (aligned_ptr).size, MEM_RELEASE))
+ if (!VirtualFree (aligned_ptr, 0, MEM_RELEASE))
error (EXIT_FAILURE, 0, "Failed to free memory");
+ break;
#else
abort ();
#endif