mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Don't #include internal header <os/tsd.h> on platforms that don't need it.
Swift SVN r8468
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
#include "swift/Runtime/Alloc.h"
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
// We'll include this and do per-thread clean up once we actually have threads
|
||||
//#include <System/pthread_machdep.h>
|
||||
#include "Private.h"
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -373,6 +371,11 @@ void *swift::swift_slowAlloc(size_t bytes, uint64_t flags) {
|
||||
// These are implemented in FastEntryPoints.s on some platforms.
|
||||
#ifndef SWIFT_HAVE_FAST_ENTRY_POINTS
|
||||
|
||||
#if __has_include(<os/tsd.h>)
|
||||
// OS X and iOS internal version
|
||||
|
||||
#include <os/tsd.h>
|
||||
|
||||
struct AllocCacheEntry {
|
||||
struct AllocCacheEntry *next;
|
||||
};
|
||||
@@ -451,6 +454,12 @@ void swift::swift_rawDealloc(void *ptr, AllocIndex idx) {
|
||||
setRawAllocCacheEntry(idx, cur);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# error no thread-local cache implementation for this platform
|
||||
|
||||
#endif
|
||||
|
||||
// !SWIFT_HAVE_FAST_ENTRY_POINTS
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user