move copy constructor for json_data
@mitzimorris がすでに取り組んでいます。
2019年7月4日 から。
評価
この issue はまだ評価されていません。
説明
Summary:
As json_data is being used in CmdStan, it does this:
stan::json::json_data d(stream);
stream.close();
std::shared_ptr<stan::io::var_context> result
= std::make_shared<stan::json::json_data>(d);
return result;
The class json_data is a subclass of var_context. It does not define a copy constructor, so the default copy constructor will be invoked by that call to make_shared (which constructs an object and returns a shared pointer to it that encapsulates the memory management). That means a deep copy of all the data. That means all the data sits in memory twice while this block is executing.
To solve this problem, we need to define move semantics so that the returned object constructed in the shared pointer can steal the data from the local object.
I'm not sure how to test this as we want to make sure we reduce total dynamic memory overhead requirements.
Current Version:
v2.19.1
- 主要言語
- C++
- スター
- 240
- フォーク
- 105
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stan-dev/cmdstan のほかの issue
-
Release CmdStan 2.40オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
code-cleanup
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
diagnose exit codeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
stan-dev/cmdstan の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
rhalbersma/xstd-ints#395 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Root filesystem scope (/) incorrectly rejects all descendant paths対応中かも @mugenkyou が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
neutralinojs/neutralino.js#304 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
FuSa
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tenstorrent/tt-umd#3851 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
mattgodbolt/zindex#67 ·
メンテナーはふだん 1 日以内に返信