On 05 Apr 2016, at 01:57, Jonathan Hull via swift-users
wrote:
>
> I had a quick question on the memory used by enums with associated values in
> the current implementation. If I have an enum like the following:
>
> enum MyEnum {
> case mostCommonlyUsed
> case somewhatCommon (Int,
> On 06 Jan 2016, at 12:20, Dmitri Gribenko wrote:
>
> On Wed, Jan 6, 2016 at 12:47 PM, Daniel Eggert via swift-users
> wrote:
>> I’m storing an Int? inside a [String:Any] but I can’t retrieve it again. Is
>> this expected behaviour or a bug in Swift?
>>
>&g
I’m storing an Int? inside a [String:Any] but I can’t retrieve it again. Is
this expected behaviour or a bug in Swift?
/Daniel
% swift
Welcome to Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b,
Swift 1f2908b4f7). Type :help for assistance. 3> let d: [String:Any] = ["foo":
(nil
ed.passUnretained(mapped)
> defer { unmanaged.release() }
>
> let buffer = UnsafeBufferPointer(start: UnsafePointer(base),
> count: size / sizeof(Void))
> return someFunction(buffer)
> }
>
> Best Regards,
> Chris
>
> > On 05 Jan 2016, at 16:57, Daniel Eg
How do I extend the lifetime of a variable, i.e. make sure that ARC is less
aggressive?
clang has an attribute called objc_precise_lifetime — does Swift have something
similar?
I have this code:
do {
var base = UnsafePointer()
var size = Int()
let mapped = dispatch_data_create_m
> On 24 Dec 2015, at 03:11, Dmitri Gribenko wrote:
>
> On Wed, Dec 23, 2015 at 3:24 PM, Daniel Eggert via swift-users
> wrote:
>> I have an array of String and need to call withCString on each one and then
>> pass the resulting array of UnsafePointer to a C api. The un
On 18 Dec 2015, at 20:42, Chris Lattner wrote:
>
>
>> On Dec 17, 2015, at 1:47 PM, Daniel Eggert via swift-users
>> wrote:
>>
>> If I need access to the C fcntl(2):
>>
>> int fcntl(int, int, ...)
>>
>> can I get the swift-package-manage
I have an array of String and need to call withCString on each one and then
pass the resulting array of UnsafePointer to a C api. The unsafe pointer
is only valid within the scope of withCString.
So I built the following, but the compiler doesn’t like it:
% swift scopedReduceAndApply.swift
sco
> On 17 Dec 2015, at 22:47, Daniel Eggert via swift-users
> wrote:
>
> If I need access to the C fcntl(2):
>
> int fcntl(int, int, ...)
>
> can I get the swift-package-manager or swift-build-tool to compile C code
> that wraps this into a no
If I need access to the C fcntl(2):
int fcntl(int, int, ...)
can I get the swift-package-manager or swift-build-tool to compile C code that
wraps this into a non-vararg version:
int SocketHelper_fcntl_setFlags(int const fildes, int const flags)
{
return fcntl(fildes, F_SETFL, flags);
10 matches
Mail list logo