> On Aug 9, 2016, at 12:07 PM, Joe Groff wrote:
>
>
>> On Aug 5, 2016, at 9:42 AM, KS Sreeram via swift-users
>> wrote:
>>
>>
>>> On 05-Aug-2016, at 1:19 PM, Daniel Vollmer wrote:
>>>
>>> I’m by no means a Swift expert (not even a user at the moment), but I don't
>>> see a way to do this
> On Aug 5, 2016, at 9:42 AM, KS Sreeram via swift-users
> wrote:
>
>
>> On 05-Aug-2016, at 1:19 PM, Daniel Vollmer wrote:
>>
>> I’m by no means a Swift expert (not even a user at the moment), but I don't
>> see a way to do this either. The best that comes to mind is initializing a
>> Contig
on Fri Aug 05 2016, KS Sreeram wrote:
>> On 05-Aug-2016, at 1:19 PM, Daniel Vollmer wrote:
>>
>> I’m by no means a Swift expert (not even a user at the moment), but I don't
>> see a way to do this either. The best that comes to mind is initializing a
>> ContiguousArray with the sufficient capa
> On 05-Aug-2016, at 4:02 PM, Brent Royal-Gordon wrote:
>
> I don't believe this is possible with an Array; the only way to work with
> uninitialized memory is with an UnsafeMutablePointer.
>
> The simplest solution is probably to load the data into an allocated chunk of
> memory with an Uns
> On 05-Aug-2016, at 1:19 PM, Daniel Vollmer wrote:
>
> I’m by no means a Swift expert (not even a user at the moment), but I don't
> see a way to do this either. The best that comes to mind is initializing a
> ContiguousArray with the sufficient capacity as size, using
> withUnsafeBufferPointer
> On Aug 4, 2016, at 11:42 PM, KS Sreeram via swift-users
> wrote:
>
> I’m trying to initialize a byte-array efficiently with minimal copying with
> the following steps:
>
> 1. Create an empty byte array.
> 2. Reserve sufficient capacity in the array.
> 3. Use mutable pointers into the array t
Hello
I’m trying to initialize a byte-array efficiently with minimal copying with the
following steps:
1. Create an empty byte array.
2. Reserve sufficient capacity in the array.
3. Use mutable pointers into the array to fill in the data.
4. The actual size that was filled is known only after it