mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 00:01:34 +11:00
add safety comments to public unsafe functions
This commit is contained in:
parent
71559a28d2
commit
c12ae4b5d9
|
@ -231,6 +231,10 @@ pub struct Gba {
|
|||
impl Gba {
|
||||
#[doc(hidden)]
|
||||
#[must_use]
|
||||
/// # Safety
|
||||
///
|
||||
/// May only be called a single time. It is not needed to call this due to
|
||||
/// it being called internally by the [`entry`] macro.
|
||||
pub unsafe fn new_in_entry() -> Self {
|
||||
Self::single_new()
|
||||
}
|
||||
|
|
|
@ -33,6 +33,8 @@ pub fn memory_write_hint<T>(val: *mut T) {
|
|||
/// This seems to be a problem caused by Rust issue #62256:
|
||||
/// <https://github.com/rust-lang/rust/issues/62256>
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// **WARNING FOR ANYONE WHO FINDS THIS**: This implementation will *only* be
|
||||
/// correct on the GBA, and should not be used on any other platform. The GBA
|
||||
/// is very old, and has no atomics to begin with - only a main thread and
|
||||
|
|
Loading…
Reference in a new issue