diff --git a/RxSwift/Observables/Observable+Single.swift b/RxSwift/Observables/Observable+Single.swift index 675bb472..7b1efb9c 100644 --- a/RxSwift/Observables/Observable+Single.swift +++ b/RxSwift/Observables/Observable+Single.swift @@ -131,7 +131,9 @@ extension ObservableType { /** Repeats the source observable sequence the specified number of times in case of an error or until it successfully terminates. - - parameter maxAttemptCount: Number of times to repeat the sequence. + If you encounter an error and want it to retry once, then you must use `retry(2)` + + - parameter maxAttemptCount: Maximum number of times to repeat the sequence. - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ public func retry(maxAttemptCount: Int) diff --git a/RxTests/PerformanceTests/main.swift b/RxTests/PerformanceTests/main.swift index f46c887e..53ce2b89 100644 --- a/RxTests/PerformanceTests/main.swift +++ b/RxTests/PerformanceTests/main.swift @@ -32,7 +32,7 @@ func measureTime(@noescape work: () -> ()) -> UInt64 { } let timeInNano = (mach_absolute_time() - start) * UInt64(timebaseInfo.numer) / UInt64(timebaseInfo.denom) - return approxValuePerIteration(timeInNano) / 1000 + return approxValuePerIteration(timeInNano) / UInt64(NumberOfIterations) } func measureMemoryUsage(@noescape work: () -> ()) -> (bytesAllocated: UInt64, allocations: UInt64) { diff --git a/RxTests/RxTests.xcodeproj/project.pbxproj b/RxTests/RxTests.xcodeproj/project.pbxproj index 34ec7ba2..2362c406 100644 --- a/RxTests/RxTests.xcodeproj/project.pbxproj +++ b/RxTests/RxTests.xcodeproj/project.pbxproj @@ -199,7 +199,6 @@ C84B8FC11B89D0D500C9CCCF /* BagTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BagTest.swift; sourceTree = ""; }; C85F4E421B7F70EA00A866C7 /* CompositeObserverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompositeObserverTest.swift; sourceTree = ""; }; C8633AE41B0A9FF300375D60 /* KVOObservableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KVOObservableTests.swift; sourceTree = ""; }; - C868D0EF1BB75EA1003D1474 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; C868D0F81BB76A29003D1474 /* PerformanceTools.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PerformanceTools.swift; sourceTree = ""; }; C868D1091BB950D3003D1474 /* PerformanceTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerformanceTests.app; sourceTree = BUILT_PRODUCTS_DIR; }; C868D10B1BB950D4003D1474 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; @@ -270,7 +269,6 @@ C8A468CC1B8A897800BF917B /* RxCocoa.framework */, C836EA001B8A76A900AB941D /* RxSwift.framework */, C81108221AF50E11001C13E4 /* Tests */, - C868D0EE1BB75EA1003D1474 /* PerformanceTests */, C868D10A1BB950D4003D1474 /* PerformanceTests */, C81108211AF50E11001C13E4 /* Products */, ); @@ -400,14 +398,6 @@ path = Tests; sourceTree = ""; }; - C868D0EE1BB75EA1003D1474 /* PerformanceTests */ = { - isa = PBXGroup; - children = ( - C868D0EF1BB75EA1003D1474 /* main.swift */, - ); - path = PerformanceTests; - sourceTree = ""; - }; C868D10A1BB950D4003D1474 /* PerformanceTests */ = { isa = PBXGroup; children = ( diff --git a/RxTests/Tests/PerformanceTools.swift b/RxTests/Tests/PerformanceTools.swift index 5701de9e..bc2422c9 100644 --- a/RxTests/Tests/PerformanceTools.swift +++ b/RxTests/Tests/PerformanceTools.swift @@ -57,8 +57,6 @@ func registerMallocHooks() { assert(Int(count) <= proxies.count) - let defaultZone = malloc_default_zone() - for i in 0 ..< Int(count) { let zoneArray = zones.advancedBy(i) let name = malloc_get_zone_name(zoneArray.memory) @@ -72,7 +70,7 @@ func registerMallocHooks() { let protectSize = vm_size_t(sizeof(malloc_zone_t)) * vm_size_t(count) - if zone.version >= 8 { + if true { let addressPointer = UnsafeMutablePointer(zoneArray) let res = vm_protect(mach_task_self_, addressPointer.memory, protectSize, 0, PROT_READ | PROT_WRITE) assert(res == 0) @@ -80,7 +78,7 @@ func registerMallocHooks() { zoneArray.memory.memory = zone - if defaultZone.memory.version == 8 { + if true { let res = vm_protect(mach_task_self_, _zones.memory, protectSize, 0, PROT_READ) assert(res == 0) }