Skip to content

Conversation

@dsavitskiy
Copy link
Contributor

No description provided.

@dsavitskiy dsavitskiy force-pushed the feature/fix-mem-leak branch from 98a7f08 to f4cf93f Compare June 22, 2023 11:23
static mut BUF: Vec<u8> = Vec::new();
let s = String::from($crate::version_info!());
unsafe {
BUF.resize(s.len(), 0);
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't a second call to this invalidate the first memory as we're resizing?
would OnceCell be more appropriate usage?

Signed-off-by: Dmitry Savitskiy <dmitry.savitskiy@datacore.com>
@dsavitskiy dsavitskiy force-pushed the feature/fix-mem-leak branch from f4cf93f to a1b0cea Compare June 30, 2023 14:38
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