Skip to content

[stdlib]@inlinable audit for ContiguousArray #20371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions stdlib/public/core/ContiguousArrayBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ internal var _emptyArrayStorage : __EmptyArrayStorage {
}

// The class that implements the storage for a ContiguousArray<Element>
@_fixed_layout // FIXME(sil-serialize-all)
@_fixed_layout
@usableFromInline
internal final class _ContiguousArrayStorage<
Element
> : __ContiguousArrayStorageBase {

@inlinable // FIXME(sil-serialize-all)
@inlinable
deinit {
_elementPointer.deinitialize(count: countAndCapacity.count)
_fixLifetime(self)
Expand Down Expand Up @@ -654,7 +654,7 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer<Element> {

/// Initialize the buffer with an initial size of `initialCapacity`
/// elements.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always) // For performance reasons.
internal init(initialCapacity: Int) {
if initialCapacity == 0 {
Expand All @@ -670,7 +670,7 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer<Element> {
}

/// Add an element to the buffer, reallocating if necessary.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always) // For performance reasons.
internal mutating func add(_ element: Element) {
if remainingCapacity == 0 {
Expand All @@ -693,7 +693,7 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer<Element> {
}

/// Add an element to the buffer, which must have remaining capacity.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always) // For performance reasons.
internal mutating func addWithExistingCapacity(_ element: Element) {
_sanityCheck(remainingCapacity > 0,
Expand All @@ -709,7 +709,7 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer<Element> {
///
/// Returns the fully-initialized buffer. `self` is reset to contain an
/// empty buffer and cannot be used afterward.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always) // For performance reasons.
internal mutating func finish() -> ContiguousArray<Element> {
// Adjust the initialized count of the buffer.
Expand All @@ -724,7 +724,7 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer<Element> {
///
/// Returns the fully-initialized buffer. `self` is reset to contain an
/// empty buffer and cannot be used afterward.
@inlinable // FIXME(sil-serialize-all)
@inlinable
@inline(__always) // For performance reasons.
internal mutating func finishWithOriginalCount() -> ContiguousArray<Element> {
_sanityCheck(remainingCapacity == result.capacity - result.count,
Expand Down