Lines Matching +full:default +full:- +full:on
3 // SPDX-License-Identifier: GPL-2.0-or-later
11 // preserve one-item-per-"use" syntax, it is clearer
12 // for prelude-like modules
48 ) -> bindings::gpointer; in g_aligned_alloc0()
54 fn qemu_memalign(alignment: usize, size: usize) -> *mut c_void; in qemu_memalign()
59 fn g_malloc0(n_bytes: bindings::gsize) -> bindings::gpointer; in g_malloc0()
65 /// It is enabled by default with the `allocator` feature.
85 // From the glibc documentation, on GNU systems, malloc guarantees 16-byte
86 // alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See
87 // https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html.
88 // This alignment guarantee also applies to Windows and Android. On Darwin
89 // and OpenBSD, the alignment is 16 bytes on both 64-bit and 32-bit systems.
108 pub const fn new() -> Self { in new()
113 impl Default for QemuAllocator {
114 fn default() -> Self { in default() method
123 unsafe fn alloc(&self, layout: Layout) -> *mut u8 { in alloc()
124 …if matches!(Self::DEFAULT_ALIGNMENT_BYTES, Some(default) if default.checked_rem(layout.align()) ==… in alloc()
150 …if matches!(Self::DEFAULT_ALIGNMENT_BYTES, Some(default) if default.checked_rem(layout.align()) ==… in dealloc()
153 // glib-allocated pointer, so `g_free`ing is safe. in dealloc()
159 // glib-allocated pointer, so `g_aligned_free`ing is safe. in dealloc()
165 // glib-allocated pointer, so `qemu_vfree`ing is safe. in dealloc()