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

[Question] why define SSIZE_MAX as (LLONG_MAX >> 1) in sds.h #1067

Open
icelee123 opened this issue May 27, 2022 · 2 comments
Open

[Question] why define SSIZE_MAX as (LLONG_MAX >> 1) in sds.h #1067

icelee123 opened this issue May 27, 2022 · 2 comments
Assignees

Comments

@icelee123
Copy link

why not LLONG_MAX but LLONG_MAX / 2 ?

@icelee123 icelee123 changed the title [Question] why define SSIZE_MAX as (LLONG_MAX >> 1) [Question] why define SSIZE_MAX as (LLONG_MAX >> 1) in sds.h May 27, 2022
@michael-grunder
Copy link
Collaborator

Maybe I misunderstand the question but LLONG_MAX / 2 and LLONG_MAX >> 1 should be equivalent.

@icelee123
Copy link
Author

LLONG_MAX value is 2^32-1, which is the max value of signed long long.
The max signed size_t value is also 2^32-1.
So I think SSIZE_MAX == LLONG_MAX.

But here we define SSIZE_MAX as (LLONG_MAX >> 1), why?

@michael-grunder michael-grunder self-assigned this Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants