File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,14 @@ pub unsafe fn exchange_free(ptr: *c_char) {
90
90
91
91
#[ lang="malloc" ]
92
92
#[ inline( always) ]
93
+ #[ cfg( stage0) ] // For some reason this isn't working on windows in stage0
94
+ pub unsafe fn local_malloc ( td : * c_char , size : uintptr_t ) -> * c_char {
95
+ return rustrt:: rust_upcall_malloc_noswitch ( td, size) ;
96
+ }
97
+
98
+ #[ lang="malloc" ]
99
+ #[ inline( always) ]
100
+ #[ cfg( not( stage0) ) ]
93
101
pub unsafe fn local_malloc( td : * c_char , size : uintptr_t ) -> * c_char {
94
102
match context ( ) {
95
103
OldTaskContext => {
@@ -110,6 +118,17 @@ pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
110
118
// problem occurs, call exit instead.
111
119
#[ lang="free" ]
112
120
#[ inline( always) ]
121
+ #[ cfg( stage0) ]
122
+ pub unsafe fn local_free ( ptr : * c_char ) {
123
+ rustrt:: rust_upcall_free_noswitch ( ptr) ;
124
+ }
125
+
126
+ // NB: Calls to free CANNOT be allowed to fail, as throwing an exception from
127
+ // inside a landing pad may corrupt the state of the exception handler. If a
128
+ // problem occurs, call exit instead.
129
+ #[ lang="free" ]
130
+ #[ inline( always) ]
131
+ #[ cfg( not( stage0) ) ]
113
132
pub unsafe fn local_free ( ptr : * c_char ) {
114
133
match context ( ) {
115
134
OldTaskContext => {
You can’t perform that action at this time.
0 commit comments