Skip to content

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

Open
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/ozstream-unique-ptr
Open

Refactor ozstream raw pointers to unique_ptr; modernize orstream copy ops#667
lyskov-ai wants to merge 1 commit intoRosettaCommons: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
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.

2 participants