silk.platform.windows.heap.
Process-heap storage for the Windows runtime and the system allocator.
When to use#
Use Allocator.systemAllocatorProvider for owned application storage. WindowsHeap supplies
raw runtime storage and adopted allocations without a C runtime.
Import as WindowsHeap with import silk.platform.windows.heap { WindowsHeap }.
Public declarations: 1.
WindowsHeap#
pub struct WindowsHeapStorage from the process heap, with no C runtime dependency.
Implementation WindowsHeap#
impl WindowsHeapAssociated function acquire#
pub fn acquire(size: usize) -> ?*mut u8Returns uninitialized storage aligned to 16 bytes, or null on failure. A zero size allocates one byte.
Gotchas#
Release a successful result exactly once with WindowsHeap.release, after all access ends.
Associated function release#
pub unsafe fn release(memory: ?*mut u8) -> ()Releases storage from WindowsHeap.acquire. Null does nothing.
Gotchas#
memory must be null or an unreleased result from WindowsHeap.acquire. No access can remain.
Associated function allocate#
pub effect fn allocate(layout: Layout) -> Intrinsic.Allocation ! OutOfMemoryErrorReturns owned storage for layout, including alignments greater than 16 bytes.
Errors#
OutOfMemoryErrorif alignment is invalid, size arithmetic overflows, or the heap refuses storage.
Category: Windows platform.
Profiles: x86_64-pc-windows-msvc.