Join shm_pair.info and .segment of Windows shm implementation#8648
Closed
cmb69 wants to merge 1 commit intophp:masterfrom
Closed
Join shm_pair.info and .segment of Windows shm implementation#8648cmb69 wants to merge 1 commit intophp:masterfrom
cmb69 wants to merge 1 commit intophp:masterfrom
Conversation
There is not much point in having two distinct file mappings; since the info mapping is very small and of fixed size, we can put it at the beginning of a single mapping. Besides the obvious resource savings, that also simplifies the error handling.
Member
Author
|
If there are no objections, I'll merge this by the end of the week. |
This was referenced Oct 14, 2022
TysonAndre
reviewed
Oct 25, 2022
| } | ||
|
|
||
| shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); | ||
| shm->addr = shm->descriptor + sizeof(shm->descriptor); |
Contributor
There was a problem hiding this comment.
The error handling here is wrong, if (NULL == shm->addr) { would be comparing shm->descriptor + sizeof(shm->descriptor); against NULL
As a result, this would start returning non-null.
At a quick glance, the rest of the pointer operations seemed normal
I suspect some part of this change is related to krakjoe/apcu#445 - apcu calls shmat in 3 places https://github.com/krakjoe/apcu/blob/v5.1.22/apc_shm.c#L72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is not much point in having two distinct file mappings; since the
info mapping is very small and of fixed size, we can put it at the
beginning of a single mapping. Besides the obvious resource savings,
that also simplifies the error handling.