@@ -15,56 +15,34 @@ import SwiftShims
15
15
// Definitions that make elements of Builtin usable in real code
16
16
// without gobs of boilerplate.
17
17
18
- /// Returns the contiguous memory footprint of `T`.
19
- ///
20
- /// Does not include any dynamically-allocated or "remote" storage.
21
- /// In particular, `sizeof(X.self)`, when `X` is a class type, is the
22
- /// same regardless of how many stored properties `X` has.
23
- @available ( * , deprecated, message: " use MemoryLayout<T>.size instead. " )
24
- @_transparent
18
+ @available ( * , unavailable, message: " use MemoryLayout<T>.size instead. " )
25
19
public func sizeof< T> ( _: T . Type ) -> Int {
26
- return Int ( Builtin . sizeof ( T . self ) )
20
+ Builtin . unreachable ( )
27
21
}
28
22
29
- /// Returns the contiguous memory footprint of `T`.
30
- ///
31
- /// Does not include any dynamically-allocated or "remote" storage.
32
- /// In particular, `sizeof(a)`, when `a` is a class instance, is the
33
- /// same regardless of how many stored properties `a` has.
34
- @available ( * , deprecated, message: " use MemoryLayout<T>.size instead. " )
35
- @_transparent
23
+ @available ( * , unavailable, message: " use MemoryLayout<T>.size instead. " )
36
24
public func sizeofValue< T> ( _: T ) -> Int {
37
- return sizeof ( T . self )
25
+ Builtin . unreachable ( )
38
26
}
39
27
40
- /// Returns the minimum memory alignment of `T`.
41
- @available ( * , deprecated, message: " use MemoryLayout<T>.alignment instead. " )
42
- @_transparent
28
+ @available ( * , unavailable, message: " use MemoryLayout<T>.alignment instead. " )
43
29
public func alignof< T> ( _: T . Type ) -> Int {
44
- return Int ( Builtin . alignof ( T . self ) )
30
+ Builtin . unreachable ( )
45
31
}
46
32
47
- /// Returns the minimum memory alignment of `T`.
48
- @available ( * , deprecated, message: " use MemoryLayout<T>.alignment instead. " )
49
- @_transparent
33
+ @available ( * , unavailable, message: " use MemoryLayout<T>.alignment instead. " )
50
34
public func alignofValue< T> ( _: T ) -> Int {
51
- return alignof ( T . self )
35
+ Builtin . unreachable ( )
52
36
}
53
37
54
- /// Returns the least possible interval between distinct instances of
55
- /// `T` in memory. The result is always positive.
56
- @available ( * , deprecated, message: " use MemoryLayout<T>.stride instead. " )
57
- @_transparent
38
+ @available ( * , unavailable, message: " use MemoryLayout<T>.stride instead. " )
58
39
public func strideof< T> ( _: T . Type ) -> Int {
59
- return Int ( Builtin . strideof_nonzero ( T . self ) )
40
+ Builtin . unreachable ( )
60
41
}
61
42
62
- /// Returns the least possible interval between distinct instances of
63
- /// `T` in memory. The result is always positive.
64
- @available ( * , deprecated, message: " use MemoryLayout<T>.stride instead. " )
65
- @_transparent
43
+ @available ( * , unavailable, message: " use MemoryLayout<T>.stride instead. " )
66
44
public func strideofValue< T> ( _: T ) -> Int {
67
- return strideof ( T . self )
45
+ Builtin . unreachable ( )
68
46
}
69
47
70
48
// This function is the implementation of the `_roundUp` overload set. It is
0 commit comments