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

Fixed Crash on 32bits Architecture #14

Merged
merged 1 commit into from
Sep 29, 2015
Merged

Fixed Crash on 32bits Architecture #14

merged 1 commit into from
Sep 29, 2015

Conversation

RuiAAPeres
Copy link

This fixes issue #13

@kean
Copy link
Owner

kean commented Sep 29, 2015

Thanks, I'll take a look a little bit later. I guess that NSProcessInfo.processInfo().physicalMemory returns invalid value like UInt64.max starting with iOS 9 (can't test atm). If it does then we should either find an alternative API or just always return some default value as a recommendedCacheTotalLimit. Returning Int.max is unreasonable, 32-bits devices can't even address more memory.

@RuiAAPeres
Copy link
Author

I tested that on the simulator (my carthage file is currently pointing to that commit) and it's working. But we can look for another alternative.

@kean
Copy link
Owner

kean commented Sep 29, 2015

Oh, actually physicalMemory works fine. It's just that you have more than 8 Gb of RAM :)

(1024 * 1024 * 1024 * 16) * 0.2 = 3 435 973 836
3 435 973 836 > 2 147 483 647 (Int.max on 32 bit)

kean added a commit that referenced this pull request Sep 29, 2015
Fixed Crash on 32bits Architecture
@kean kean merged commit 87581c8 into kean:master Sep 29, 2015
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

Successfully merging this pull request may close these issues.

2 participants