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

Fix system memory size of tvOS #2099

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

karelrooted
Copy link
Contributor

@karelrooted karelrooted commented Dec 16, 2023

use sysctlbyname("hw.memsize") to get sytem memory size instead of host_info, host_info is not available on tvOS, so we change to sysctlbyname which support all apple platforms

the sytem memory size of tvOS is hardcoded as 0 currently, found this bug while using libplacebo's vulkan render to play video on tvOS

apple document didn't stat this API is available on tvOS though

@CLAassistant
Copy link

CLAassistant commented Dec 16, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

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

Thanks for the submission!

So strange that tvOS is the only platform that doesn't support host_info().

However, in testing your submission here, sysctlbyname() is available on all platforms, and gives the same numeric results as host_info() on both macOS and iOS.

So, can you modify this PR to remove the platform compile macros, and just use your new code for all platforms, please?

use sysctlbyname("hw.memsize") to get sytem memory size instead of host_info,
host_info is not available on tvOS, so we change to sysctlbyname which support all apple platforms

apple document didn't stat this API is available on tvOS though,
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname
@karelrooted
Copy link
Contributor Author

PR is updated to use sysctlbyname to get system memory size for all apple platforms

Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

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

Thanks!

@billhollings billhollings merged commit 9fbf8a1 into KhronosGroup:main Dec 19, 2023
6 checks passed
@karelrooted karelrooted deleted the fix-tvos-memory-size branch December 25, 2023 02:29
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.

None yet

3 participants