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

C# use IDisposable to avoid unnecessary copies

Đang mở
#164 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement hacktoberfest help wanted
Ngôn ngữ chính
C++
Star
26
Fork
25
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.