Function allocAdvancedWithRetAddr [src]

Prototype

pub inline fn allocAdvancedWithRetAddr( self: Allocator, comptime T: type, comptime alignment: ?u29, n: usize, return_address: usize, ) Error![]align(alignment orelse @alignOf(T)) T

Parameters

self: AllocatorT: typealignment: ?u29null means naturally aligned n: usizereturn_address: usize

Possible Errors

OutOfMemory

Source

pub inline fn allocAdvancedWithRetAddr( self: Allocator, comptime T: type, /// null means naturally aligned comptime alignment: ?u29, n: usize, return_address: usize, ) Error![]align(alignment orelse @alignOf(T)) T { const a = alignment orelse @alignOf(T); const ptr: [*]align(a) T = @ptrCast(try self.allocWithSizeAndAlignment(@sizeOf(T), a, n, return_address)); return ptr[0..n]; }