Files
gcc-reflection/libstdc++-v3
Jonathan Wakely f50f2efae9 libstdc++: Prefer posix_memalign for aligned-new [PR113258]
As described in PR libstdc++/113258 there are old versions of tcmalloc
which replace malloc and related APIs, but do not repalce aligned_alloc
because it didn't exist at the time they were released. This means that
when operator new(size_t, align_val_t) uses aligned_alloc to obtain
memory, it comes from libc's aligned_alloc not from tcmalloc. But when
operator delete(void*, size_t, align_val_t) uses free to deallocate the
memory, that goes to tcmalloc's replacement version of free, which
doesn't know how to free it.

If we give preference to the older posix_memalign instead of
aligned_alloc then we're more likely to use a function that will be
compatible with the replacement version of free. Because posix_memalign
has been around for longer, it's more likely that old third-party malloc
replacements will also replace posix_memalign alongside malloc and free.

libstdc++-v3/ChangeLog:

	PR libstdc++/113258
	* libsupc++/new_opa.cc: Prefer to use posix_memalign if
	available.
2024-01-11 17:35:57 +00:00
..
2024-01-03 12:19:35 +01:00
2024-01-03 12:19:35 +01:00
2024-01-03 12:19:35 +01:00
2024-01-03 12:19:35 +01:00
2024-01-11 00:18:50 +00:00
2023-01-01 16:20:13 +01:00
2024-01-03 11:29:39 +01:00
2023-11-17 15:28:43 +00:00
2024-01-03 12:19:35 +01:00
2023-12-22 10:24:56 +00:00

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.