Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# use IDisposable to avoid unnecessary copies #164

Open
AddressXception opened this issue Mar 8, 2021 · 3 comments
Open

C# use IDisposable to avoid unnecessary copies #164

AddressXception opened this issue Mar 8, 2021 · 3 comments
Labels
enhancement New feature or request hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed

Comments

@AddressXception
Copy link
Collaborator

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.

@AddressXception AddressXception added enhancement New feature or request help wanted Extra attention is needed labels Aug 3, 2021
@AddressXception AddressXception added the code owner only Only for Code Owner label Sep 20, 2021
@lmarie79 lmarie79 added the hacktoberfest Issues for the Hacktoberfest label Sep 20, 2021
@keithrfung keithrfung removed the code owner only Only for Code Owner label Oct 3, 2021
@gagandeepp
Copy link

intersted please assign

@keithrfung
Copy link
Collaborator

@gagandeepp Have at it.

@gagandeepp
Copy link

gagandeepp commented Oct 8, 2021

@AddressXception I was able to setup dev environment of this repo.
Do I need to make changes in ElectionGuard.Encryption/Group.cs?
Let me know when we can connect on this ??
@keithrfung I am having some doubts related to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants