summaryrefslogtreecommitdiffstats
path: root/vendor/dlmalloc/src/dummy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/dlmalloc/src/dummy.rs')
-rw-r--r--vendor/dlmalloc/src/dummy.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/dlmalloc/src/dummy.rs b/vendor/dlmalloc/src/dummy.rs
new file mode 100644
index 000000000..bd8d5b6e2
--- /dev/null
+++ b/vendor/dlmalloc/src/dummy.rs
@@ -0,0 +1,42 @@
+use core::ptr;
+use Allocator;
+
+pub struct System {
+ _priv: (),
+}
+
+impl System {
+ pub const fn new() -> System {
+ System { _priv: () }
+ }
+}
+
+unsafe impl Allocator for System {
+ fn alloc(&self, _size: usize) -> (*mut u8, usize, u32) {
+ (ptr::null_mut(), 0, 0)
+ }
+
+ fn remap(&self, _ptr: *mut u8, _oldsize: usize, _newsize: usize, _can_move: bool) -> *mut u8 {
+ ptr::null_mut()
+ }
+
+ fn free_part(&self, _ptr: *mut u8, _oldsize: usize, _newsize: usize) -> bool {
+ false
+ }
+
+ fn free(&self, _ptr: *mut u8, _size: usize) -> bool {
+ false
+ }
+
+ fn can_release_part(&self, _flags: u32) -> bool {
+ false
+ }
+
+ fn allocates_zeros(&self) -> bool {
+ false
+ }
+
+ fn page_size(&self) -> usize {
+ 1
+ }
+}