Fields

hardware None
os None

Parameters

Fields

NameValue

Parameters

NameValue
git_commit commit cedb44af53f195135e8e8de98f161048d19f8857
Author: Louis Dionne <ldionne.2@gmail.com>
Date: Mon Jan 13 09:10:36 2025 -0500

[libc++] Pass type information down to __libcpp_allocate (#118837)

Currently, places where we call __libcpp_allocate must drop type
information on the ground even when they actually have such information
available. That is unfortunate since some toolchains and system
allocators are able to provide improved security when they know what
type is being allocated.

This is the purpose of http://wg21.link/p2719, where we introduce a new
variant of `operator new` which takes a type in its interface. A
different but related issue is that `std::allocator` does not honor any
in-class `T::operator new` since it is specified to call the global
`::operator new` instead.

This patch closes the gap to make it trivial for implementations that
provide typed memory allocators to actually benefit from that
information in more contexts, and also makes libc++ forward-compatible
with future proposals that would fix the existing defects in
`std::allocator`. It also makes the internal allocation API higher level
by operating on objects instead of operating on bytes of memory.

Since this is a widely-used function and making this a template could
have an impact on debug info sizes, I tried minimizing the number of
templated layers by removing `__do_deallocate_handle_size`, which was
easy to replace with a macro (and IMO this leads to cleaner code).
Filter

ldionne-old-macbook-results test results

Run Order Start Time Duration
Current 523623 2025-12-16T16:40:01 0:00:00
Previous 523625 2025-12-16T16:40:01 0:00:00
Baseline 485288 2025-12-16T16:40:01 0:00:00


Tests Summary

Status Group # # (B)
Performance Regressions 1 0
Performance Improvements 2 0
Added Tests 1 18
Unchanged Tests 86 72
Total Tests 90

Performance Regressions - execution_time Δ Previous Current σ Δ (B) σ (B)
727_cppcheck_r 3.02% 24.161 24.890 - 0.00% -

Performance Improvements - execution_time Δ Previous Current σ Δ (B) σ (B)
748_flightdm_r -2.68% 9.057 8.814 - 0.00% -
767_nest_r -1.94% 14.377 14.099 - 0.00% -

Added Tests - execution_time
735_gem5_r

Added Tests - execution_time
706_stockfish_r
707_ntest_r
709_cactus_r
710_omnetpp_r
721_gcc_r
723_llvm_r
727_cppcheck_r
729_abc_r
731_astcenc_r
734_vpr_r
735_gem5_r
736_ocio_r
737_gmsh_r
748_flightdm_r
750_sealcrypto_r
753_ns3_r
766_femflow_r
767_nest_r


Report Time: 0.12s
Name Current %
706_stockfish_r 22.121 -
707_ntest_r 17.830 -
709_cactus_r 19.742 -
710_omnetpp_r 8.485 -
721_gcc_r 12.926 -
723_llvm_r 11.421 -
727_cppcheck_r 24.890 3.02%
729_abc_r 18.677 -
731_astcenc_r 10.019 -
734_vpr_r 15.287 -
735_gem5_r 13.674 -
736_ocio_r 16.167 -
737_gmsh_r 13.026 -
748_flightdm_r 8.814 -2.68%
750_sealcrypto_r 18.312 -
753_ns3_r 10.341 -
766_femflow_r 12.761 -
767_nest_r 14.099 -1.94%
Geometric Mean 14.268 -