Since classes that don’t escape the scope are allocated on the stack, does this mean we can use ManagedBuffer
as a swift version of alloca
?
let buffer:ManagedBuffer<Void, UInt8> = .create(minimumCapacity: count){ _ in }
buffer.withUnsafeMutablePointerToElements
{
...
}
is this valid swift?