> On Apr 17, 2017, at 12:37 PM, Karl Wagner <[email protected]> wrote:
>
>> On 17 Apr 2017, at 19:52, Anders Kierulf via swift-evolution
>> <[email protected] <mailto:[email protected]>> wrote:
>>
>> Proposal: UnsafeMutablePointer almost provides what I need. However, it can
>> only allocate memory on the heap, or it can take a given blob of memory and
>> interpret it as something else. What’s missing is a way to allocate typed
>> memory of a certain size on the stack or in a struct. For example, something
>> like this, with support for subscripts, limited to value types:
>
> What happens if you use alloca?
Doesn’t look like using alloca is recommended in Swift:
https://bugs.swift.org/browse/SR-323
Also, while it might be used as a hack for stack allocations, it wouldn’t allow
inclusion into structs.
Anders
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution