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

Add MemoryDataStream::reset() method #2677

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Oct 20, 2023

The class already has a clear() method but this leaves existing memory allocated. The purpose is to allow re-use of an existing class instance efficiently by reducing memory reallocations.

The new reset() method allows the instance to be cleared and also release allocated memory. The new name is consistent with std::unique_ptr::reset() usage.

A similar thing can be accomplished by using std::unique_ptr<MemoryDataStream> however an in-built reset() method makes for cleaner code.

@what-the-diff
Copy link

what-the-diff bot commented Oct 20, 2023

PR Summary

  • Addition of reset Function to MemoryDataStream Class
    This update introduces a new feature called reset in the MemoryDataStream class. The purpose of this function is to clear the stream and free up any memory that was being used, improving performance and potentially preventing any system slowdown due to excessive memory consumption. This change enhances the functionality and efficiency of our system.

@slaff slaff added this to the 5.1.0 milestone Oct 20, 2023
@slaff slaff merged commit 68a6e24 into SmingHub:develop Oct 21, 2023
36 checks passed
@mikee47 mikee47 deleted the feature/memorystream-reset branch October 21, 2023 19:24
@slaff slaff mentioned this pull request Oct 24, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants