Some way to support an a handler for `BOOST_ASSERT(_MSG)` that takes a `std::source_location`
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- cpp
- 領域
- testing-qa
調査の方向性
まず、既存の BOOST_ASSERT handler API と BOOST_ASSERT(_MSG) がどのように展開されるかを確認します。提案されている std::source_location を使った handler オプションを、カスタマイズ可能な BOOST_ASSERT_FAILURE_HANDLER() マクロおよび BOOST_ASSERT_MSG_FAILURE_HANDLER() マクロと比較します。メンテナーが承認した API 設計と、それに対応する実装範囲が決まれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem: Using std::source_location is more efficient than passing separate file/line/column/func info because the location is a single pointer to static storage, rather than 2 pointer + 2 const ints. That can result in codegen bloat, especially on platforms like Aarch64 where it takes multiple instructions to load a global pointer. Given the usecase of assertions, this is often used for very cold (hopefully never executed!) code that sits in the same function as hot code, so you often want to make it as small as possible to maximize icache and iTLB. Note that it is important to use source_location from std:: rather than boost:: because the std:: flavor uses implementation techniques that are not available to userspace C++ to make it a single pointer to static storage.
Possible solution 1: Add a new macro like BOOST_ENABLE_ASSERT_HANDLER_WITH_STD_SOURCE_LOCATION to opt into a different handler API that takes std::source_location.
Possible solution 2: Give the user full control over the handler expression by just making the failure case be a macro call like BOOST_ASSERT_FAILURE_HANDLER() and BOOST_ASSERT_MSG_FAILURE_HANDLER(msg). The only tricky issue is that you would likely need some way to inject declarations and #includes into global scope, but it may be reasonable to say that anyone who can use this facility correctly can probably also use -include "my_boost_assert_prefix_header.h". This option also has the advantage for anyone who wants to use __builtin_trap() to get the ultimate code size reduction, while still checking asserts.
- 主要言語
- C++
- スター
- 35
- フォーク
- 77
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/assert のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
boostorg/assert の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
games-on-whales/wolf#509 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug-unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/cuda-samples#453 ·