Function cloneWithDifferentAllocator [src]

Prototype

pub fn cloneWithDifferentAllocator(other: Managed, allocator: Allocator) !Managed

Parameters

other: Managedallocator: Allocator

Source

pub fn cloneWithDifferentAllocator(other: Managed, allocator: Allocator) !Managed { return Managed{ .allocator = allocator, .metadata = other.metadata, .limbs = block: { const limbs = try allocator.alloc(Limb, other.len()); @memcpy(limbs, other.limbs[0..other.len()]); break :block limbs; }, }; }