Skip to content

Refactor ozstream raw pointers to unique_ptr; modernize orstream copy ops#667

Merged
lyskov merged 1 commit into
RosettaCommons:mainfrom
lyskov-ai:refactor/ozstream-unique-ptr
May 7, 2026
Merged

Refactor ozstream raw pointers to unique_ptr; modernize orstream copy ops#667
lyskov merged 1 commit into
RosettaCommons:mainfrom
lyskov-ai:refactor/ozstream-unique-ptr

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

  • Replace three raw owning pointers in ozstream (char_buffer_p_, zip_stream_p_, mpi_stream_p_) with std::unique_ptr, eliminating manual delete/nullptr pairs in open(), open_append(), open_append_if_existed(), close(), and the buffer helpers
  • Modernize the private-undefined copy constructor/assignment in orstream to explicit = delete, consistent with the approach used in irstream/izstream (PR Refactor izstream raw zip_stream_p_ pointer to unique_ptr #664)

Test plan

  • Full debug build passes (python3 ./scons.py -j16 mode=debug)
  • No behavior change expected — ownership semantics are identical; close() still runs zflush_finalize() and mpi_ostream::close()/clear() before releasing the pointers

… ops

Replace three raw owning pointers in ozstream (char_buffer_p_, zip_stream_p_,
mpi_stream_p_) with std::unique_ptr, eliminating manual delete/nullptr pairs
throughout open(), open_append(), open_append_if_existed(), close(), and the
buffer helpers. Also replace the old private-undefined copy ctor/assignment in
orstream with explicit = delete, consistent with the irstream/izstream refactor.
@lyskov lyskov requested a review from roccomoretti May 1, 2026 17:22
@lyskov lyskov merged commit 3653412 into RosettaCommons:main May 7, 2026
1 check passed
lyskov pushed a commit that referenced this pull request May 8, 2026
- Replace old-style private-and-undefined copy constructor/assignment in
`utility/io/irstream` with explicit `= delete`
- Mirrors the same treatment already applied to the sibling `orstream`
class (PR #667)
@lyskov-ai lyskov-ai deleted the refactor/ozstream-unique-ptr branch May 8, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants