Election-Tech-Initiative / Election-Tech-Initiative/electionguard-cpp

C# use IDisposable to avoid unnecessary copies

オープン
#164 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement hacktoberfest help wanted
主要言語
C++
スター
26
フォーク
25
PR マージ指標
30日以内にマージされた PR はありません

説明

## Feature Request

**Description**
In a few places, there are unnecessary copy operations when moving between managed and unmanaged blocks of memory. For instance:
- `Group.cs#ElementModP#NewNative`
- `Ballot.cs#CompactCiphertextBallot#ctor`

This request is to refactor the managed code to expose the unmanaged objects directly where necessary by pinning the memory and bypassing the garbage collector. IDisposable should be used on the managed side to call the unmanaged "_free" functions when necessary. Careful consideration must be given to ownership as not every contiguous block of memory returned to managed code is actually owned by the caller.

The implemented pattern should be consistently applied throughout the C# binding layer.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。