New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mem.res.pool.overview] add proper definitions of terms #1964
base: main
Are you sure you want to change the base?
Conversation
e3dbfe2
to
1a21a65
Compare
Update cross-reference in [mem.res.pool.options] to refer to [mem.res.pool.overview]. Fixes cplusplus#1258
Rebased, all comments from @CaseyCarter and @Quuxplusone addressed. |
@jwakely , this is a large-ish change, and @zygoloid added the "lwg" label four years ago. Do you think this should go via LWG, or should be just collect some endorsement here from @CaseyCarter and others? |
I think it should go via LWG. I'll ask for some reflector reviews of this and #2550 and some others with the lwg label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but LGTM FWIW!
source/memory.tex
Outdated
it obtained from its upstream memory resource by calling | ||
the upstream resource's \tcode{deallocate} function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it has obtained
Abbreviating as the upstream resource's
here feels just a little weird to me, since the true name is the upstream memory resource's
and if we're aiming for brevity we could just say the upstream's
.
I admit that my eye caught on this paragraph originally because it refers to "the memory
it [has] obtained from its upstream memory resource by calling the upstream resource's deallocate function"; when in fact that memory was obtained by calling the upstream's allocate function! But I have no suggested fix for that grammar quirk, so my brain found other nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
On a call to
release()
, a pool resource calls its upstream memory resource'sdeallocate
function to return all the memory that was obtained from its upstream memory resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or "that was obtained from upstream".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor tweak:
On a call to
release()
, a pool resource calls its upstream memory resource'sdeallocate
function to return all the memory that has been obtained from its upstream memory resource.
Or "all the outstanding memory," but that's a little jargony. Could even say "all the chunks that have been obtained," if that's correct. Can't say "has ever been obtained," because we really do mean only the outstanding chunks, not ones that were allocated before the last call to release()
nor ones that have already been deallocated via deallocate
.
Wildly ambitious rewrite:
On a call to
release()
, a pool resource calls its upstream memory resource'sdeallocate
function on every chunk that has not yet been deallocated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it doesn't say all memory that has ever been allocated, and we don't bother making that distinction for containers freeing memory with an allocator.
Update cross-reference in [mem.res.pool.options] to refer to
[mem.res.pool.overview].
Fixes #1258