1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#[allow(unused_imports)]
use self::super::root;
#[repr(C)]
pub struct StandardAllocator {
pub mIsInitialized: bool,
pub mIsEnabledThreadCache: bool,
pub _2: u16,
pub mAllocAddr: *mut u64,
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocator10InitializeEPvm"]
pub fn StandardAllocator_Initialize(
this: *mut StandardAllocator,
address: *mut u8,
size: u64,
);
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocator8FinalizeEv"]
pub fn StandardAllocator_Finalize(this: *mut StandardAllocator);
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocator10ReallocateEPvm"]
pub fn StandardAllocator_Reallocate(
this: *mut StandardAllocator,
address: *mut u8,
newSize: u64,
) -> *mut u8;
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocator8AllocateEm"]
pub fn StandardAllocator_Allocate(
this: *mut StandardAllocator,
size: u64,
) -> *mut u8;
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocator4FreeEPv"]
pub fn StandardAllocator_Free(
this: *mut StandardAllocator,
address: *mut u8,
);
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocator4DumpEv"]
pub fn StandardAllocator_Dump(this: *mut StandardAllocator);
}
extern "C" {
#[link_name = "\u{1}_ZN2nn3mem17StandardAllocatorC1Ev"]
pub fn StandardAllocator_StandardAllocator(
this: *mut StandardAllocator,
);
}
impl StandardAllocator {
#[inline]
pub unsafe fn Initialize(&mut self, address: *mut u8, size: u64) {
StandardAllocator_Initialize(self, address, size)
}
#[inline]
pub unsafe fn Finalize(&mut self) {
StandardAllocator_Finalize(self)
}
#[inline]
pub unsafe fn Reallocate(
&mut self,
address: *mut u8,
newSize: u64,
) -> *mut u8 {
StandardAllocator_Reallocate(self, address, newSize)
}
#[inline]
pub unsafe fn Allocate(&mut self, size: u64) -> *mut u8 {
StandardAllocator_Allocate(self, size)
}
#[inline]
pub unsafe fn Free(&mut self, address: *mut u8) {
StandardAllocator_Free(self, address)
}
#[inline]
pub unsafe fn Dump(&mut self) {
StandardAllocator_Dump(self)
}
#[inline]
pub unsafe fn new() -> Self {
let mut __bindgen_tmp = ::core::mem::MaybeUninit::uninit();
StandardAllocator_StandardAllocator(__bindgen_tmp.as_mut_ptr());
__bindgen_tmp.assume_init()
}
}