Skip to content

Commit ca4898f

Browse files
authored
Merge pull request #19213 from lorentey/hashtable-unification
[stdlib] Set, Dictionary: Hash table unification, general cleanup before ABI stability
2 parents 18e6ea7 + 9ae572f commit ca4898f

18 files changed

+3498
-3189
lines changed

stdlib/public/SwiftShims/GlobalObjects.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,42 @@ struct _SwiftEmptyArrayStorage {
4040
SWIFT_RUNTIME_STDLIB_API
4141
struct _SwiftEmptyArrayStorage _swiftEmptyArrayStorage;
4242

43-
struct _SwiftUnsafeBitMap {
44-
__swift_uintptr_t *values;
45-
__swift_intptr_t bitCount;
46-
};
47-
4843
struct _SwiftDictionaryBodyStorage {
49-
__swift_intptr_t capacity;
5044
__swift_intptr_t count;
51-
struct _SwiftUnsafeBitMap initializedEntries;
52-
void *keys;
53-
void *values;
45+
__swift_intptr_t capacity;
46+
__swift_intptr_t scale;
47+
__swift_uint64_t seed0;
48+
__swift_uint64_t seed1;
49+
void *rawKeys;
50+
void *rawValues;
5451
};
5552

5653
struct _SwiftSetBodyStorage {
57-
__swift_intptr_t capacity;
5854
__swift_intptr_t count;
59-
struct _SwiftUnsafeBitMap initializedEntries;
60-
void *keys;
55+
__swift_intptr_t capacity;
56+
__swift_intptr_t scale;
57+
__swift_uint64_t seed0;
58+
__swift_uint64_t seed1;
59+
void *rawElements;
6160
};
6261

63-
struct _SwiftEmptyDictionaryStorage {
62+
struct _SwiftEmptyDictionarySingleton {
6463
struct HeapObject header;
6564
struct _SwiftDictionaryBodyStorage body;
66-
__swift_uintptr_t entries;
65+
__swift_uintptr_t metadata;
6766
};
6867

69-
struct _SwiftEmptySetStorage {
68+
struct _SwiftEmptySetSingleton {
7069
struct HeapObject header;
7170
struct _SwiftSetBodyStorage body;
72-
__swift_uintptr_t entries;
71+
__swift_uintptr_t metadata;
7372
};
7473

7574
SWIFT_RUNTIME_STDLIB_API
76-
struct _SwiftEmptyDictionaryStorage _swiftEmptyDictionaryStorage;
75+
struct _SwiftEmptyDictionarySingleton _swiftEmptyDictionarySingleton;
7776

7877
SWIFT_RUNTIME_STDLIB_API
79-
struct _SwiftEmptySetStorage _swiftEmptySetStorage;
78+
struct _SwiftEmptySetSingleton _swiftEmptySetSingleton;
8079

8180
struct _SwiftHashingParameters {
8281
__swift_uint64_t seed0;
@@ -91,9 +90,9 @@ struct _SwiftHashingParameters _swift_stdlib_Hashing_parameters;
9190

9291
static_assert(std::is_pod<_SwiftEmptyArrayStorage>::value,
9392
"empty array type should be POD");
94-
static_assert(std::is_pod<_SwiftEmptyDictionaryStorage>::value,
93+
static_assert(std::is_pod<_SwiftEmptyDictionarySingleton>::value,
9594
"empty dictionary type should be POD");
96-
static_assert(std::is_pod<_SwiftEmptySetStorage>::value,
95+
static_assert(std::is_pod<_SwiftEmptySetSingleton>::value,
9796
"empty set type should be POD");
9897

9998
}} // extern "C", namespace swift

stdlib/public/core/ArrayShared.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func _deallocateUninitializedArray<Element>(
6161
// Utility method for collections that wish to implement CustomStringConvertible
6262
// and CustomDebugStringConvertible using a bracketed list of elements,
6363
// like an array.
64-
@inlinable // FIXME(sil-serialize-all)
6564
internal func _makeCollectionDescription<C: Collection>
6665
(for items: C, withTypeName type: String?) -> String {
6766
var result = ""

0 commit comments

Comments
 (0)