Replace new/delete calls for Block* with malloc and free
まだ誰も着手していません。
評価
調査の方向性
The change sits in the MemPoolT template, which allocates and frees its Block* objects with new and delete; start by reading its block allocation and teardown code in tinyxml2.h. The reporter's workaround swaps in malloc and free, but the thread does not settle whether that is the right fix or whether the real problem is destruction order with a custom global allocator. Before editing, confirm that direction with a maintainer. Done means the pool's block lifetime is correct under overridden operator new and delete, with the existing tests still passing.
索引モデルが issue の本文から書いたものです。
説明
Hello,
I am writing a program in which the new and delete operators are overloaded in order to use a custom allocator, and I found that the new and delete calls to allocate and deallocate memory for Block* in MemPoolT was causing several memory issues. I fixed these by replacing these with malloc() and free(). I'm not sure exactly why these issues were occurring.
EDIT: I believe this is because my allocator deconstructed the memory before the memory pool, meaning the memory pool was trying to deallocate memory that no longer exists
- 主要言語
- C++
- スター
- 5.8k
- フォーク
- 2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
leethomason/tinyxml2 のほかの issue
-
XMLNode::InsertAfterChild dereferences NULL when addThis is already afterThis's next sibling対応中かも @zhouyunding が 16 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
leethomason/tinyxml2#1101 ·
-
CDATA output containing ]]> is not well-formed XML対応中かも @bconnnnn が 27 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
leethomason/tinyxml2#1097 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
leethomason/tinyxml2#923 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
leethomason/tinyxml2#914 ·
-
New release requestオープン
難易度 2/5 1時間未満 初心者へのやさしさ 15/100
leethomason/tinyxml2#1087 · コメント 4 件 ·
leethomason/tinyxml2 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA-RTX/NRI#312 ·
メンテナーはふだん 1 日以内に返信
-
permute_q_b_proj / permute_wv_proj accept scale factors from another device対応中かも @0z5a が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepseek-ai/FlashMLA#247 ·
メンテナーはふだん 1 日以内に返信
-
Linux npm packaging leaves workspace files that block subsequent CI checkout対応中かも @Spockkk0225 が今日担当しました。 オープンci
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
alibaba/neug#1195 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信