Cleaned memory management for bitstream #41

Closed
Gregor Weiss wants to merge 0 commits from develop-gws into feat/api
Collaborator

The goal of this PR is to guarantee untouched memory after the API changes take user-owned data and buffers.

As proposed in issue #36, memory (re-)allocations are avoided as possible.

terminate_stream is wholly resolved and split into two functions: shrink_to_fit and transfer_to_span.

bwc_stream.codestream.data can be removed too.

bwc_compress now returns the size of the compressed stream.

The goal of this PR is to guarantee untouched memory after the API changes take user-owned data and buffers. As proposed in issue #36, memory (re-)allocations are avoided as possible. `terminate_stream` is wholly resolved and split into two functions: `shrink_to_fit` and `transfer_to_span`. `bwc_stream.codestream.data` can be removed too. `bwc_compress` now returns the size of the compressed stream.
Gregor Weiss added this to the Maintainbarkeit project 2024-07-02 16:45:17 +00:00
Gregor Weiss requested review from Patrick Vogler 2024-07-02 16:45:24 +00:00

I am going to review the code as soon as I have time to. However, I noticed that you still alter the arguments list in the comment block of a function. If this is done out of fidelity to the old comment block style you should consider using the new coding style that is referenced in the docs/template files to save you some time.

I am going to review the code as soon as I have time to. However, I noticed that you still alter the arguments list in the comment block of a function. If this is done out of fidelity to the old comment block style you should consider using the new coding style that is referenced in the docs/template files to save you some time.
Gregor Weiss force-pushed develop-gws from e6990686bc to 3242165d90 2024-07-03 08:48:27 +00:00 Compare

Function deliminator in bitstream.h and codestream.h are missing; please add them for the next pull request. Additionally, we are still allocating the bitstream structure - are we going to keep it this way or will we, in the future, pass a pointer for the corresponding struct to the init routine.

Other than that the changes are sensible.

Function deliminator in bitstream.h and codestream.h are missing; please add them for the next pull request. Additionally, we are still allocating the bitstream structure - are we going to keep it this way or will we, in the future, pass a pointer for the corresponding struct to the init routine. Other than that the changes are sensible.
Patrick Vogler closed this pull request 2024-07-09 10:01:31 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TOPIO/BigWhoop#41
No description provided.