Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Mar 21, 2018

Update cross-reference in [mem.res.pool.options] to refer to
[mem.res.pool.overview].

Fixes #1258

source/utilities.tex Outdated Show resolved Hide resolved
source/utilities.tex Outdated Show resolved Hide resolved
source/utilities.tex Outdated Show resolved Hide resolved
source/utilities.tex Outdated Show resolved Hide resolved
source/utilities.tex Outdated Show resolved Hide resolved
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jun 15, 2021
Update cross-reference in [mem.res.pool.options] to refer to
[mem.res.pool.overview].

Fixes cplusplus#1258
@jwakely
Copy link
Member Author

jwakely commented Apr 20, 2022

Rebased, all comments from @CaseyCarter and @Quuxplusone addressed.

@jwakely jwakely removed the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Apr 20, 2022
@jensmaurer
Copy link
Member

@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?

@jwakely
Copy link
Member Author

jwakely commented Apr 20, 2022

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.

Copy link
Contributor

@Quuxplusone Quuxplusone left a 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 Show resolved Hide resolved
Comment on lines 5824 to 5825
it obtained from its upstream memory resource by calling
the upstream resource's \tcode{deallocate} function.
Copy link
Contributor

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.

Copy link
Member Author

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's deallocate function to return all the memory that was obtained from its upstream memory resource.

Copy link
Member Author

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".

Copy link
Contributor

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's deallocate 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's deallocate function on every chunk that has not yet been deallocated.

Copy link
Member Author

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.

source/memory.tex Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mem.res.pool.overview] Implicit definition of terms
7 participants