Files
swift-nio/Sources/NIO
Jake 3c879ebbaf Fast atomics (#1263)
Motivation:

The existing Atomic class holds an UnsafeEmbeddedAtomic which holds an OpaquePointer to raw memory for the C atomic. This results in multiple allocations on init. The new NIOAtomic class uses ManagedBufferPointer which tail allocates memory for the C atomic as part of the NIOAtomic class allocation.

Modifications:

Created NIOAtomic class that uses ManagedBufferPointer to allocate memory for the C atomic. Created version of catmc_atomic_* C functions that expect memory to be allocated/deallocated by caller. Created NIOAtomicPrimitive protocol for the new version of catmc_atomic_* functions.

Result:

Purely additive. NIOAtomic is available as a replacement for Atomic which results in fewer memory allocations.
2019-11-28 07:45:05 +00:00
..
2019-10-16 22:06:55 -07:00
2019-11-28 07:45:05 +00:00
2019-10-16 22:06:55 -07:00
2019-11-28 07:45:05 +00:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-02-01 15:34:59 +00:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2018-12-07 21:15:34 +00:00