Skip to content

Replace unsigned char/char by std::byte wherever possible - #64

Merged
daxmawal merged 4 commits into
CExA-project:mainfrom
daxmawal:issue-61-std-byte
Oct 16, 2026
Merged

daxmawal merged 4 commits into
CExA-project:mainfrom
daxmawal:issue-61-std-byte

Conversation

@daxmawal

@daxmawal daxmawal commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #61 : Replace the currently using char / char* with std::byte / std::byte*.

Comment thread src/krepe/replay/allocation.hpp
@science-enthusiast

Copy link
Copy Markdown
Member

unsigned char is still being used in many places. Can those usages be replaced by std::byte?

daxmawal and others added 2 commits October 15, 2026 20:56
Co-authored-by: Hariprasad Kannan <hkannan@gmail.com>
@daxmawal

daxmawal commented Oct 15, 2026 •

Copy link
Copy Markdown
Member Author

unsigned char is still being used in many places. Can those usages be replaced by std::byte?

Sure, I can include those changes in this PR, in the capture and extraction code.

@daxmawal daxmawal changed the title Use std::byte for replay buffers Replace all unsigned char and char * to std::byte Oct 15, 2026
Comment thread src/krepe/capture/view_dump.cpp
@daxmawal

Copy link
Copy Markdown
Member Author

Done, I've migrated the remaining binary buffers and related interfaces.

@science-enthusiast

Copy link
Copy Markdown
Member

At many places, wherever a buffer is not modified, the pointers has now been made into a pointer to const. How do you keep track of all the places where this is applicable?

@science-enthusiast science-enthusiast changed the title Replace all unsigned char and char * to std::byte Replace unsigned char/char by std::byte wherever possible Oct 16, 2026
@daxmawal

daxmawal commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

The pointers are only used as sources for memcpy, cudaMemcpy or hipMemcpy, including in the allocation helpers, and I'm also using Clang Tidy.

https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html

@science-enthusiast science-enthusiast left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Further updates can be made in the future, if their need is discovered. But the manner in which the changes have been done in this PR, appears systematic to me.

@daxmawal
daxmawal merged commit 76a729a into CExA-project:main Oct 16, 2026
16 checks passed
@daxmawal

Copy link
Copy Markdown
Member Author

Thank you Hari, merged.

@daxmawal
daxmawal deleted the issue-61-std-byte branch October 16, 2026 07:58
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.

Use std::byte

2 participants