This function works flawlessly in Release build:
func markAndTell( talk: Bool, number: Int)
{
let nbrOfThreads = 8
let step = 2
let itemsPerThread = number * step
let bitLimit = nbrOfThreads * itemsPerThread
var bitfield = [Bool](count: bitLimit,
> On 13 Sep 2016, at 14:49, Quinn The Eskimo! via swift-users
> <swift-users@swift.org> wrote:
>
>
> On 13 Sep 2016, at 05:03, Gerriet M. Denkmann via swift-users
> <swift-users@swift.org> wrote:
>
>> Or is the code fundamentally wrong …?
>
> Th
> On 23 Sep 2016, at 12:09, Marco S Hyman <m...@snafu.org> wrote:
>
> On Sep 22, 2016, at 9:51 PM, Gerriet M. Denkmann via swift-users
> <swift-users@swift.org> wrote:
>>
>> This line (Swift 3):
>> if a.responds(to: Selector(“viewControllers&q
This line (Swift 3):
if a.responds(to: Selector(“viewControllers") )
creates this warning: Use '#selector' instead of explicitly constructing a
'Selector'
Ok. Following this advice I change it to:
if a.responds(to: #selector(“viewControllers"))
and now get an error instead:
This used to work in Swift 2.2:
var bitfield: UnsafeMutablePointer?
bitfield = UnsafeMutablePointer( malloc( 888 ) )
How is this written in Swift 3.0?
Gerriet.
___
swift-users mailing list
swift-users@swift.org
ted, but not initialized.”
What about calloc then? Or use allocate and do a memset afterwards?
Thanks a lot for your help!
Kind regards,
Gerriet.
>> 23. sep. 2016 kl. 10.47 skrev Gerriet M. Denkmann via swift-users
>> <swift-users@swift.org>:
>>
>> This used to work i
> On 23 Sep 2016, at 15:47, Gerriet M. Denkmann via swift-users
> <swift-users@swift.org> wrote:
>
> This used to work in Swift 2.2:
>
> var bitfield: UnsafeMutablePointer?
> bitfield = UnsafeMutablePointer( malloc( 888 ) )
>
> How is this written in Swif
> On 3 Oct 2016, at 19:17, Jean-Denis Muys via swift-users
> wrote:
>
> You are right: I don’t know much about asian languages.
>
> How would you go about counting consonants, vowels (and tone-marks?) in the
> most general way?
Iterate over unicodeScalars (in the most
> On 3 Oct 2016, at 16:28, Jean-Denis Muys via swift-users
> wrote:
>
> ASCII? Probably not. Latin? perhaps, though not obvious. For example French
> accented letters would probably have to be handled somehow. Greek or
> Cyrillic? Perhaps. Other scripts? Unlikely, but
> On 23 Sep 2016, at 19:41, Quinn The Eskimo! via swift-users
> <swift-users@swift.org> wrote:
>
>
> On 23 Sep 2016, at 11:29, Gerriet M. Denkmann via swift-users
> <swift-users@swift.org> wrote:
>
>> What about calloc then? Or use allocate and do a m
In ObjC:
dispatch_queue_t queue = dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_HIGH, 0 );
dispatch_apply( nbrThreads, queue, ^void(size_t idx) …
In Swift 3:
DispatchQueue.concurrentPerform( iterations: nbrThreads) …
How can one specify the DISPATCH_QUEUE_PRIORITY or
> On 25 Sep 2016, at 23:08, Saagar Jha <saa...@saagarjha.com> wrote:
>
> You might be looking for the DispatchQoS.QoSClass enum.
>
> Saagar Jha
Probably. But how to make concurrentPerform use any of these enums?
Gerriet.
>
>> On Sep 25, 2016, at 05:19, Gerri
With:
let nbrBytes = 400_000_000
let localArray = UnsafeMutablePointer.allocate(capacity: nbrBytes)
// touch every page before summing:
for i in 0 ..< nbrBytes / 4096 { localArray[ 4096 * i ] = 1 }
This rather innocent loop:
var count: UInt64 = 0
for index in 0 ..< loopLimit { count +=
uint64_t nbrBytes = 4e8;
uint64_t count = 0;
for( uint64_t byteIndex = 0; byteIndex < nbrBytes; byteIndex++ )
{
count += byteIndex;
if ( ( byteIndex & 0x ) == 0 ) { count += 1.3; } (AAA)
};
Takes 260 msec.
Btw.: Without the (AAA) line the whole loop is done in 10 μsec.
How to translate this to Swift:
__block atomic_uint_fast64_t counter = ATOMIC_VAR_INIT(0);
dispatch_apply( nbrInterations, queue, ^void(size_t idx)
{
uint64_t tCount = 0;
... do some counting ...
atomic_fetch_add_explicit( , tCount,
> On 12 Oct 2016, at 23:05, Joe Groff via swift-users <swift-users@swift.org>
> wrote:
>
>>
>> On Oct 12, 2016, at 2:25 AM, Gerriet M. Denkmann via swift-users
>> <swift-users@swift.org> wrote:
>>
>> uint64_t nbrBytes = 4e8;
>> uint
ected code below
> var status: Int {
> didSet { doSomething() }
> }
>
> Geordie
>
>
>> Am 10.07.2017 um 17:34 schrieb Gerriet M. Denkmann via swift-users
>> <swift-users@swift.org>:
>>
>> This works (Xcode Version 8.3.2 (8E2002)):
>>
>>
This works (Xcode Version 8.3.2 (8E2002)):
class SomeClass
{
private var privateStatus: Int
var status: Int
{
get{ return privateStatus }
set(new)
{
if new == privateStatus {return}
18 matches
Mail list logo