Skip to content

HYRAX-2222, for non-super chunk cases, release the buffer used by a c… - #1422

Merged
kyang2014 merged 2 commits into
masterfrom
hyrax-2222
Aug 13, 2026
Merged

HYRAX-2222, for non-super chunk cases, release the buffer used by a c…#1422
kyang2014 merged 2 commits into
masterfrom
hyrax-2222

Conversation

@kyang2014

@kyang2014 kyang2014 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

…hunk after reading data of a dmrpp array.

Description

Reference ticket: HYRAX-2020

Release memory after reading the array variable data when the data storage is contiguous or only contains one chunk.
Otherwise, the memory of these variables will only be released right before the dmr object is destroyed.

Tasks

  • Ticket exists and is linked in title
  • No TODOs added

@kyang2014
kyang2014 marked this pull request as draft August 12, 2026 21:24
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@kyang2014
kyang2014 marked this pull request as ready for review August 13, 2026 16:01

@jgallagher59701 jgallagher59701 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.

Two comments, but neither prevents merging the code.

return read_string_array();

// Sonar cloud marks the following log vulnerable to injection attacks. So comment out for the time being.
#if 0

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.

We could remove this.

virtual void release_chunk_buffer()
{
if (d_read_buffer_is_mine)
delete[] d_read_buffer;

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.

This might be something we address in a future ticket. I wonder if Claude could provide suggestions WRT replacing the explicit memory management with unique pointers as private class members.

But, for now, lets keep this as it is since this works and the change Sonar is asking for is more of a maintainability change.

@kyang2014
kyang2014 merged commit faeba1c into master Aug 13, 2026
7 checks passed
@kyang2014
kyang2014 deleted the hyrax-2222 branch August 13, 2026 17:06
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