Files
swift-mirror/stdlib/shims/GlobalObjects.h
Dave Abrahams eac8ca27f9 [stdlib] Use a universal empty array buffer
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
2014-10-05 17:55:11 +00:00

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