Add an ugly hack to prevent a clever optimiser from realising that it can completely optimise objc_clear_stack() away.

main
theraven 15 years ago
parent 5b2c24bed3
commit 3769a48cd7

@ -489,6 +489,10 @@ void objc_clear_stack(unsigned long options)
// portably. // portably.
int i[1024]; int i[1024];
memset(&i, 0, 1024); memset(&i, 0, 1024);
// Tell the compiler that something that it doesn't know about is touching
// this memory, so it shouldn't optimise the allocation and memset away.
__asm__ volatile ("" : : "m"(i) : "memory");
} }
// FIXME: These are all stub implementations that should be replaced with // FIXME: These are all stub implementations that should be replaced with
// something better // something better

Loading…
Cancel
Save