@@ -26,34 +26,31 @@ public struct HeapObject {
2626 var refcount : Int
2727}
2828
29- @_silgen_name ( " posix_memalign " )
30- func posix_memalign( _: UnsafeMutablePointer < UnsafeMutableRawPointer ? > , _: UInt , _: UInt ) -> CInt
31-
32- func alignedAlloc( size: UInt , alignment: UInt ) -> UnsafeMutableRawPointer ? {
33- let alignment = max ( alignment, UInt ( MemoryLayout< UnsafeRawPointer> . size) )
29+ func alignedAlloc( size: Int , alignment: Int ) -> UnsafeMutableRawPointer ? {
30+ let alignment = max ( alignment, MemoryLayout< UnsafeRawPointer> . size)
3431 var r : UnsafeMutableRawPointer ? = nil
3532 _ = posix_memalign ( & r, alignment, size)
3633 return r
3734}
3835
3936@_cdecl ( " swift_slowAlloc " )
40- public func swift_slowAlloc( _ size: UInt , _ alignMask: UInt ) -> UnsafeMutableRawPointer ? {
41- let alignment : UInt
42- if alignMask == UInt . max {
43- alignment = UInt ( _swift_MinAllocationAlignment)
37+ public func swift_slowAlloc( _ size: Int , _ alignMask: Int ) -> UnsafeMutableRawPointer ? {
38+ let alignment : Int
39+ if alignMask == - 1 {
40+ alignment = _swift_MinAllocationAlignment
4441 } else {
4542 alignment = alignMask + 1
4643 }
4744 return alignedAlloc ( size: size, alignment: alignment)
4845}
4946
5047@_cdecl ( " swift_slowDealloc " )
51- public func swift_slowDealloc( _ ptr: UnsafeMutableRawPointer ? , _ size: UInt , _ alignMask: UInt ) {
48+ public func swift_slowDealloc( _ ptr: UnsafeMutableRawPointer ? , _ size: Int , _ alignMask: Int ) {
5249 free ( ptr)
5350}
5451
5552@_silgen_name ( " swift_allocObject " )
56- public func swift_allocObject( metadata: UnsafeMutablePointer < ClassMetadata > , requiredSize: UInt , requiredAlignmentMask: UInt ) -> UnsafeMutablePointer < HeapObject > {
53+ public func swift_allocObject( metadata: UnsafeMutablePointer < ClassMetadata > , requiredSize: Int , requiredAlignmentMask: Int ) -> UnsafeMutablePointer < HeapObject > {
5754 let p = swift_slowAlloc ( requiredSize, requiredAlignmentMask) !
5855 let object = p. assumingMemoryBound ( to: HeapObject . self)
5956 object. pointee. metadata = metadata
@@ -62,7 +59,7 @@ public func swift_allocObject(metadata: UnsafeMutablePointer<ClassMetadata>, req
6259}
6360
6461@_silgen_name ( " swift_deallocClassInstance " )
65- public func swift_deallocClassInstance( object: UnsafeMutablePointer < HeapObject > , allocatedSize: UInt , allocatedAlignMask: UInt ) {
62+ public func swift_deallocClassInstance( object: UnsafeMutablePointer < HeapObject > , allocatedSize: Int , allocatedAlignMask: Int ) {
6663 free ( object)
6764}
6865
0 commit comments