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

Replacing uintptr_t (which is not defined everywhere) with std::size_t #1981

Merged
merged 2 commits into from Feb 10, 2016

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Feb 10, 2016

This cleans up the leftovers of #1969.

@@ -232,8 +233,7 @@ namespace hpx { namespace util { namespace coroutines
std::ptrdiff_t get_available_stack_space()
{
#if defined(HPX_HAVE_THREADS_GET_STACK_POINTER)
return
reinterpret_cast<uintptr_type>(stack_pointer_) - get_stack_ptr();
return get_stack_ptr() - reinterpret_cast<std::size_t>(stack_pointer_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you switch the minuends. It should read:
reinterpret_cast<std::size_t>(stack_pointer_) - get_stack_ptr();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it consistent with the other implementations. Should this one be different?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was on purpose since the stack_pointer_ here points to the top of stack already, while the other ones point to the bottom.

sithhell added a commit that referenced this pull request Feb 10, 2016
Replacing uintptr_t (which is not defined everywhere) with std::size_t
@sithhell sithhell merged commit 8a3dd42 into master Feb 10, 2016
@sithhell sithhell deleted the replace_uintptr branch February 10, 2016 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants