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.
Closes #249 as a cool side effect
The
preserved
static struct object has been removed in favor of some inline functionsdetail::store::insert()
anddetail::store::release()
. These both access the preserve list through a static local SEXP in an extern function calleddetail::store::get()
. This exact setup is guaranteed by the standard to mean that the preserve list is unique across compilation units in the package (see notes and links to SO and the standard inprotect.hpp
).While working on #366, I learned that the current approach with the static
preserved
seems to have some issues anyways. The tests I implemented there were not consistently passing on all platforms, and seemed to change on my Mac depending on whether or not I compiled with optimization, making me think we were in undefined behavior land previously. I confirmed that everything works as expected with this new standard approved approach.