Skip to content

fix deallocate arguments in monotonic_resource and string_impl - #1179

Open
Ramya-9353 wants to merge 1 commit into
boostorg:developfrom
Ramya-9353:deallocate-size-align
Open

fix deallocate arguments in monotonic_resource and string_impl#1179
Ramya-9353 wants to merge 1 commit into
boostorg:developfrom
Ramya-9353:deallocate-size-align

Conversation

@Ramya-9353

Copy link
Copy Markdown
Contributor

Repro: parse anything through a monotonic_resource whose upstream is test/checking_resource.hpp. Every block fails size == it->second.first, and a truncated object key fails alignment == it->second.second.

Cause: do_allocate asks the upstream for sizeof(block) + next_size_ but records only next_size_ in block::size, so release() returns each block 32 bytes short on LP64. string_impl::destroy separately frees a key string with the default alignment although both key_t constructors allocate it with alignof(char). The default resource ignores both arguments, so this only bites upstreams that bucket by size or alignment.

Fix: add the header size back before deallocating, and pass alignof(char) for the key string.

@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1179.json.prtest2.cppalliance.org/libs/json/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-08-03 09:46:10 UTC

@cppalliance-bot

Copy link
Copy Markdown

GCOVR code coverage report https://1179.json.prtest2.cppalliance.org/gcovr/index.html
LCOV code coverage report https://1179.json.prtest2.cppalliance.org/genhtml/index.html
Coverage Diff Report https://1179.json.prtest2.cppalliance.org/diff-report/index.html

Build time: 2026-08-03 10:00:01 UTC

@cppalliance-bot

Copy link
Copy Markdown

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