We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0e65a9 commit e10f5b6Copy full SHA for e10f5b6
tests/ui/lto/lto-global-allocator.rs
@@ -0,0 +1,18 @@
1
+//@ compile-flags: --crate-type cdylib -C lto
2
+//@ build-pass
3
+//@ no-prefer-dynamic
4
+
5
+use std::alloc::{GlobalAlloc, Layout};
6
7
+struct MyAllocator;
8
9
+unsafe impl GlobalAlloc for MyAllocator {
10
+ unsafe fn alloc(&self, _layout: Layout) -> *mut u8 {
11
+ todo!()
12
+ }
13
14
+ unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {}
15
+}
16
17
+#[global_allocator]
18
+static GLOBAL: MyAllocator = MyAllocator;
0 commit comments