@@ -60,7 +60,6 @@ struct OpaqueValue;
60
60
// / POSSIBILITIES: The argument order is fair game. It may be useful
61
61
// / to have a variant which guarantees zero-initialized memory.
62
62
SWIFT_RT_ENTRY_VISIBILITY
63
- extern " C"
64
63
HeapObject *swift_allocObject (HeapMetadata const *metadata,
65
64
size_t requiredSize,
66
65
size_t requiredAlignmentMask)
@@ -170,15 +169,13 @@ BoxPair::Return (*_swift_allocBox)(Metadata const *type)
170
169
// An "alignment mask" is just the alignment (a power of 2) minus 1.
171
170
172
171
SWIFT_RT_ENTRY_VISIBILITY
173
- extern " C"
174
172
void *swift_slowAlloc (size_t bytes, size_t alignMask)
175
173
SWIFT_CC(RegisterPreservingCC);
176
174
177
175
178
176
// If the caller cannot promise to zero the object during destruction,
179
177
// then call these corresponding APIs:
180
178
SWIFT_RT_ENTRY_VISIBILITY
181
- extern " C"
182
179
void swift_slowDealloc (void *ptr, size_t bytes, size_t alignMask)
183
180
SWIFT_CC(RegisterPreservingCC);
184
181
@@ -195,15 +192,13 @@ void swift_slowDealloc(void *ptr, size_t bytes, size_t alignMask)
195
192
// / It may also prove worthwhile to have this use a custom CC
196
193
// / which preserves a larger set of registers.
197
194
SWIFT_RT_ENTRY_VISIBILITY
198
- extern " C"
199
195
void swift_retain (HeapObject *object)
200
196
SWIFT_CC(RegisterPreservingCC);
201
197
202
198
SWIFT_RUNTIME_EXPORT
203
199
void (*SWIFT_CC (RegisterPreservingCC) _swift_retain)(HeapObject *object);
204
200
205
201
SWIFT_RT_ENTRY_VISIBILITY
206
- extern " C"
207
202
void swift_retain_n (HeapObject *object, uint32_t n)
208
203
SWIFT_CC(RegisterPreservingCC);
209
204
@@ -212,15 +207,13 @@ void (*SWIFT_CC(RegisterPreservingCC) _swift_retain_n)(HeapObject *object,
212
207
uint32_t n);
213
208
214
209
SWIFT_RT_ENTRY_VISIBILITY
215
- extern " C"
216
210
void swift_nonatomic_retain (HeapObject *object)
217
211
SWIFT_CC(RegisterPreservingCC);
218
212
219
213
SWIFT_RUNTIME_EXPORT
220
214
void (*SWIFT_CC (RegisterPreservingCC) _swift_nonatomic_retain)(HeapObject *object);
221
215
222
216
SWIFT_RT_ENTRY_VISIBILITY
223
- extern " C"
224
217
void swift_nonatomic_retain_n (HeapObject *object, uint32_t n)
225
218
SWIFT_CC(RegisterPreservingCC);
226
219
@@ -243,7 +236,6 @@ static inline void _swift_nonatomic_retain_inlined(HeapObject *object) {
243
236
// / Atomically increments the reference count of an object, unless it has
244
237
// / already been destroyed. Returns nil if the object is dead.
245
238
SWIFT_RT_ENTRY_VISIBILITY
246
- extern " C"
247
239
HeapObject *swift_tryRetain (HeapObject *object)
248
240
SWIFT_CC(RegisterPreservingCC);
249
241
@@ -266,23 +258,23 @@ bool (* SWIFT_CC(RegisterPreservingCC) _swift_isDeallocating)(HeapObject *);
266
258
// /
267
259
// / The object reference may not be nil.
268
260
SWIFT_RT_ENTRY_VISIBILITY
269
- extern " C " HeapObject *swift_tryPin (HeapObject *object)
261
+ HeapObject *swift_tryPin (HeapObject *object)
270
262
SWIFT_CC(RegisterPreservingCC);
271
263
272
264
SWIFT_RT_ENTRY_VISIBILITY
273
- extern " C " HeapObject *swift_nonatomic_tryPin (HeapObject *object)
265
+ HeapObject *swift_nonatomic_tryPin (HeapObject *object)
274
266
SWIFT_CC(RegisterPreservingCC);
275
267
276
268
// / Given that an object is pinned, atomically unpin it and decrement
277
269
// / the reference count.
278
270
// /
279
271
// / The object reference may be nil (to simplify the protocol).
280
272
SWIFT_RT_ENTRY_VISIBILITY
281
- extern " C " void swift_unpin (HeapObject *object)
273
+ void swift_unpin (HeapObject *object)
282
274
SWIFT_CC(RegisterPreservingCC);
283
275
284
276
SWIFT_RT_ENTRY_VISIBILITY
285
- extern " C " void swift_nonatomic_unpin (HeapObject *object)
277
+ void swift_nonatomic_unpin (HeapObject *object)
286
278
SWIFT_CC(RegisterPreservingCC);
287
279
288
280
// / Atomically decrements the retain count of an object. If the
@@ -301,7 +293,6 @@ extern "C" void swift_nonatomic_unpin(HeapObject *object)
301
293
// / - maybe a variant that can assume a non-null object
302
294
// / It's unlikely that a custom CC would be beneficial here.
303
295
SWIFT_RT_ENTRY_VISIBILITY
304
- extern " C"
305
296
void swift_release (HeapObject *object)
306
297
SWIFT_CC(RegisterPreservingCC);
307
298
@@ -310,7 +301,7 @@ void (*SWIFT_CC(RegisterPreservingCC)
310
301
_swift_release)(HeapObject *object);
311
302
312
303
SWIFT_RT_ENTRY_VISIBILITY
313
- extern " C " void swift_nonatomic_release (HeapObject *object)
304
+ void swift_nonatomic_release (HeapObject *object)
314
305
SWIFT_CC(RegisterPreservingCC);
315
306
316
307
SWIFT_RUNTIME_EXPORT
@@ -321,7 +312,6 @@ void (*SWIFT_CC(RegisterPreservingCC)
321
312
// / Atomically decrements the retain count of an object n times. If the retain
322
313
// / count reaches zero, the object is destroyed
323
314
SWIFT_RT_ENTRY_VISIBILITY
324
- extern " C"
325
315
void swift_release_n (HeapObject *object, uint32_t n)
326
316
SWIFT_CC(RegisterPreservingCC);
327
317
@@ -336,7 +326,6 @@ SWIFT_RUNTIME_EXPORT
336
326
void swift_setDeallocating (HeapObject *object);
337
327
338
328
SWIFT_RT_ENTRY_VISIBILITY
339
- extern " C"
340
329
void swift_nonatomic_release_n (HeapObject *object, uint32_t n)
341
330
SWIFT_CC(RegisterPreservingCC);
342
331
@@ -385,19 +374,19 @@ bool swift_isUniquelyReferenced_native(const struct HeapObject *);
385
374
// / Is this native Swift pointer a non-null unique or pinned reference
386
375
// / to an object?
387
376
SWIFT_RT_ENTRY_VISIBILITY
388
- extern " C " bool swift_isUniquelyReferencedOrPinned_native (
377
+ bool swift_isUniquelyReferencedOrPinned_native (
389
378
const struct HeapObject *) SWIFT_CC(RegisterPreservingCC);
390
379
391
380
// / Is this non-null native Swift pointer a unique reference to
392
381
// / an object?
393
382
SWIFT_RT_ENTRY_VISIBILITY
394
- extern " C " bool swift_isUniquelyReferenced_nonNull_native (
383
+ bool swift_isUniquelyReferenced_nonNull_native (
395
384
const struct HeapObject *) SWIFT_CC(RegisterPreservingCC);
396
385
397
386
// / Does this non-null native Swift pointer refer to an object that
398
387
// / is either uniquely referenced or pinned?
399
388
SWIFT_RT_ENTRY_VISIBILITY
400
- extern " C " bool swift_isUniquelyReferencedOrPinned_nonNull_native (
389
+ bool swift_isUniquelyReferencedOrPinned_nonNull_native (
401
390
const struct HeapObject *) SWIFT_CC(RegisterPreservingCC);
402
391
403
392
// / Deallocate the given memory.
@@ -416,8 +405,8 @@ extern "C" bool swift_isUniquelyReferencedOrPinned_nonNull_native(
416
405
// / requires the object to have been fully zeroed from offsets
417
406
// / sizeof(SwiftHeapObject) to allocatedSize.
418
407
SWIFT_RT_ENTRY_VISIBILITY
419
- extern " C " void swift_deallocObject (HeapObject *object, size_t allocatedSize,
420
- size_t allocatedAlignMask)
408
+ void swift_deallocObject (HeapObject *object, size_t allocatedSize,
409
+ size_t allocatedAlignMask)
421
410
SWIFT_CC(RegisterPreservingCC);
422
411
423
412
// / Deallocate the given memory.
@@ -527,35 +516,35 @@ struct UnownedReference {
527
516
528
517
// / Increment the weak/unowned retain count.
529
518
SWIFT_RT_ENTRY_VISIBILITY
530
- extern " C " void swift_unownedRetain (HeapObject *value)
519
+ void swift_unownedRetain (HeapObject *value)
531
520
SWIFT_CC(RegisterPreservingCC);
532
521
533
522
// / Decrement the weak/unowned retain count.
534
523
SWIFT_RT_ENTRY_VISIBILITY
535
- extern " C " void swift_unownedRelease (HeapObject *value)
524
+ void swift_unownedRelease (HeapObject *value)
536
525
SWIFT_CC(RegisterPreservingCC);
537
526
538
527
// / Increment the weak/unowned retain count by n.
539
528
SWIFT_RT_ENTRY_VISIBILITY
540
- extern " C " void swift_unownedRetain_n (HeapObject *value, int n)
529
+ void swift_unownedRetain_n (HeapObject *value, int n)
541
530
SWIFT_CC(RegisterPreservingCC);
542
531
543
532
// / Decrement the weak/unowned retain count by n.
544
533
SWIFT_RT_ENTRY_VISIBILITY
545
- extern " C " void swift_unownedRelease_n (HeapObject *value, int n)
534
+ void swift_unownedRelease_n (HeapObject *value, int n)
546
535
SWIFT_CC(RegisterPreservingCC);
547
536
548
537
// / Increment the strong retain count of an object, aborting if it has
549
538
// / been deallocated.
550
539
SWIFT_RT_ENTRY_VISIBILITY
551
- extern " C " void swift_unownedRetainStrong (HeapObject *value)
540
+ void swift_unownedRetainStrong (HeapObject *value)
552
541
SWIFT_CC(RegisterPreservingCC);
553
542
554
543
// / Increment the strong retain count of an object which may have been
555
544
// / deallocated, aborting if it has been deallocated, and decrement its
556
545
// / weak/unowned reference count.
557
546
SWIFT_RT_ENTRY_VISIBILITY
558
- extern " C " void swift_unownedRetainStrongAndRelease (HeapObject *value)
547
+ void swift_unownedRetainStrongAndRelease (HeapObject *value)
559
548
SWIFT_CC(RegisterPreservingCC);
560
549
561
550
// / Aborts if the object has been deallocated.
0 commit comments