C Macro Tips and Tricks
https://www.mikeash.com/pyblog/friday-qa-2010-12-31-c-macro-tips-and-tricks.html [www.mikeash.com]
2018-11-10 21:07
tags:
c
intro-programming
C macros are at the same time too powerful and not powerful enough. Their somewhat ad-hoc nature makes them dangerous, so treat them with care.
Mostly useful stuff without getting too crazy.
source: L
Locks, Thread Safety, and Swift: 2017 Edition
http://www.mikeash.com/pyblog/friday-qa-2017-10-27-locks-thread-safety-and-swift-2017-edition.html [www.mikeash.com]
2017-10-30 17:27
tags:
concurrency
intro-programming
swift
Swift has no language facilities for thread synchronization, but the APIs make up for it. GCD remains one of Apple’s crown jewels, and the Swift API for it is great.
Swift 4 Weak References
http://www.mikeash.com/pyblog/friday-qa-2017-09-22-swift-4-weak-references.html [www.mikeash.com]
2017-09-26 18:53
tags:
garbage-collection
programming
swift
Swift’s new implementation of weak references brings with it the concept of side tables. A side table is a separate chunk of memory which stores extra information about an object. It’s optional, meaning that an object may have a side table, or it may not. Objects which need the functionality of a side table can incur the extra cost, and objects which don’t need it don’t pay for it.
Swift.Unmanaged
http://www.mikeash.com/pyblog/friday-qa-2017-08-11-swiftunmanaged.html [www.mikeash.com]
2017-08-12 18:45
tags:
c
library
programming
swift
One of Swift’s great strengths is the smoothness with which it interoperates with C code. The Unmanaged API is a key component of that. Unfortunately, it requires the programmer to make memory management decisions as pointers move in and out of Swift, but that’s an inherent part of the job it does. Once you have the memory management figured out, it’s mostly straightforward to use.
Swift.Codable
http://www.mikeash.com/pyblog/friday-qa-2017-07-14-swiftcodable.html [www.mikeash.com]
2017-07-15 17:48
tags:
programming
swift
One of the interesting additions to Swift 4 is the Codable protocol and the machinery around it. This is a subject near and dear to my heart, and I want to discuss what it is and how it works today.
Dissecting objc_msgSend on ARM64
http://www.mikeash.com/pyblog/friday-qa-2017-06-30-dissecting-objc_msgsend-on-arm64.html [www.mikeash.com]
2017-07-01 20:46
tags:
cpu
objc
perf
programming
systems
It’s always interesting to dive into framework internals. objc_msgSend in particular is a work of art, and delightful to read through.