Index: third_party/grpc/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h |
diff --git a/third_party/tcmalloc/vendor/src/base/linuxthreads.h b/third_party/grpc/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h |
similarity index 61% |
copy from third_party/tcmalloc/vendor/src/base/linuxthreads.h |
copy to third_party/grpc/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h |
index 5c318fed7ec4c47e7bf082e315992e102abcd620..0622f7067c02b5989a5853813982e41b92aaea03 100644 |
--- a/third_party/tcmalloc/vendor/src/base/linuxthreads.h |
+++ b/third_party/grpc/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h |
@@ -1,4 +1,6 @@ |
-/* Copyright (c) 2005-2007, Google Inc. |
+/* |
+ * |
+ * Copyright 2015, Google Inc. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
@@ -27,27 +29,29 @@ |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* |
- * --- |
- * Author: Markus Gutschke |
*/ |
-#ifndef _LINUXTHREADS_H |
-#define _LINUXTHREADS_H |
+#import <Foundation/Foundation.h> |
-/* Include thread_lister.h to get the interface that we implement for linux. |
- */ |
+@interface NSEnumerator (GRXUtil) |
-/* We currently only support x86-32 and x86-64 on Linux. Porting to other |
- * related platforms should not be difficult. |
+/** |
+ * Returns a NSEnumerator instance that iterates through the elements of the passed container that |
+ * supports fast enumeration. Note that this negates the speed benefits of fast enumeration over |
+ * NSEnumerator. It's only intended for the rare cases when one needs the latter and only has the |
+ * former, e.g. for iteration that needs to be paused and resumed later. |
*/ |
-#if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) || \ |
- defined(__mips__) || defined(__PPC__)) && defined(__linux) |
++ (NSEnumerator *)grx_enumeratorWithContainer:(id<NSFastEnumeration>)container; |
-/* Define the THREADS symbol to make sure that there is exactly one core dumper |
- * built into the library. |
+/** |
+ * Returns a NSEnumerator instance that provides a single object before finishing. The value is then |
+ * released. |
*/ |
-#define THREADS "Linux /proc" |
++ (NSEnumerator *)grx_enumeratorWithSingleValue:(id)value; |
-#endif |
- |
-#endif /* _LINUXTHREADS_H */ |
+/** |
+ * Returns a NSEnumerator instance that delegates the invocations of nextObject to the passed block. |
+ * When the block first returns nil, it is released. |
+ */ |
++ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block; |
+@end |