var i = 0
while i <= 0x4_0000 {
let size = malloc_size(malloc(i+1))
print(" \(i+1) => \(size) (\(size - i))")
i = size
}64-bit MacOS:
| // TODO: doc | |
| public struct OffsetBound { | |
| internal enum Kind { | |
| case fromStart(Int) | |
| case fromEnd(Int) | |
| } | |
| internal var kind: Kind | |
| internal init(fromStart: Int) { | |
| self.kind = .fromStart(fromStart) |
| // TODO: doc | |
| public struct OffsetBound<Bound> { | |
| internal enum Kind { | |
| case fromStart(Int) | |
| case fromEnd(Int) | |
| } | |
| internal var kind: Kind | |
| public init(fromStart: Int) { | |
| self.kind = .fromStart(fromStart) |
| // TODO: doc | |
| public struct OffsetBound { | |
| internal enum Kind { | |
| case fromStart(Int) | |
| case fromEnd(Int) | |
| } | |
| internal var kind: Kind | |
| public init(fromStart: Int) { | |
| self.kind = .fromStart(fromStart) |
| // TODO: doc | |
| public struct OffsetBound<Bound> { | |
| internal enum Kind { | |
| case fromStart(Int) | |
| case fromEnd(Int) | |
| } | |
| internal var kind: Kind | |
| public init(fromStart: Int) { | |
| self.kind = .fromStart(fromStart) |
| // TODO: doc | |
| public struct OffsetBound { | |
| internal enum Kind { | |
| case fromStart(Int) | |
| case fromEnd(Int) | |
| } | |
| internal var kind: Kind | |
| init(fromStart: Int) { | |
| self.kind = .fromStart(fromStart) |
| precedencegroup RelativeOffsetPrecedence { | |
| higherThan: RangeFormationPrecedence | |
| } | |
| infix operator --> : RelativeOffsetPrecedence | |
| infix operator <-- : RelativeOffsetPrecedence | |
| prefix operator --> | |
| postfix operator <-- | |
| extension Collection { |
| precedencegroup RelativeOffsetPrecedence { | |
| higherThan: RangeFormationPrecedence | |
| } | |
| infix operator ++ : RelativeOffsetPrecedence | |
| infix operator -- : RelativeOffsetPrecedence | |
| extension Collection { | |
| internal func _clampedIndex(_ idx: Index, offsetBy offset: Int) -> Index { | |
| let limit = offset < 0 ? startIndex : endIndex |
| prefix operator ^ | |
| public prefix func ^<T>(_ t: T) -> T? { return .some(t) } | |
| // | |
| // Numbers | |
| // |
| extension String.Index { | |
| /// Creates a new index at the specified UTF-16 code unit offset | |
| /// | |
| /// - Parameter offset: An offset in UTF-16 code units. | |
| public init(offset: Int, within utf16: String.UTF16View) { | |
| let (start, end) = (utf16.startIndex, utf16.endIndex) | |
| guard offset >= 0, | |
| let idx = utf16.index(start, offsetBy: offset, limitedBy: end) | |
| else { | |
| self = end |
var i = 0
while i <= 0x4_0000 {
let size = malloc_size(malloc(i+1))
print(" \(i+1) => \(size) (\(size - i))")
i = size
}64-bit MacOS: