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

Change Rust template static muts to consts #362

Merged
merged 1 commit into from
Jan 28, 2022
Merged

Conversation

majaha
Copy link
Contributor

@majaha majaha commented Jan 27, 2022

This patch changes the FRAMEBUFFER and PALETTE variables in the Rust template from pub static mut to pub const, as the pointers themselves don't ever need to be mutated or have a static memory address.

In the future, we may be able to have the framebuffer directly like this:
pub static mut FRAMEBUFFER: [u8; 6400] = unsafe { *(0xa0 as *mut [u8; 6400]) };
but this isn't stablised yet.

This patch changes the FRAMEBUFFER and PALETTE variables in the Rust template from "pub static mut" to "pub const", as the pointers themselves don't ever need to be mutated or have a static memory address.
@aduros
Copy link
Owner

aduros commented Jan 28, 2022

Thanks!

@aduros aduros merged commit f8cef3b into aduros:main Jan 28, 2022
@majaha majaha deleted the patch-2 branch March 15, 2023 05:56
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

2 participants