mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
NFC, and no significant performance change expected. This is part one of a move to eliminate nil checks from the array implementation. Swift SVN r22526
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
//===--- GlobalObjects.h - Statically-initialized objects -----------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Objects that are allocated at global scope instead of on the heap,
|
|
// and statically initialized to avoid synchronization costs, are
|
|
// defined here.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#ifndef SWIFT_STDLIB_SHIMS_GLOBALOBJECTS_H_
|
|
#define SWIFT_STDLIB_SHIMS_GLOBALOBJECTS_H_
|
|
#include "HeapObject.h"
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
namespace swift { extern "C" {
|
|
#endif
|
|
|
|
struct _SwiftArrayBodyStorage {
|
|
intptr_t count;
|
|
uintptr_t _capacityAndFlags;
|
|
};
|
|
|
|
struct _SwiftEmptyArrayStorage {
|
|
struct HeapObject header;
|
|
struct _SwiftArrayBodyStorage body;
|
|
};
|
|
|
|
extern struct _SwiftEmptyArrayStorage _swiftEmptyArrayStorage;
|
|
|
|
#ifdef __cplusplus
|
|
}} // extern "C", namespace swift
|
|
#endif
|
|
|
|
#endif
|