 	}
 }
 
-extension IsoOfImpl : CustomReflectable {
-	func customMirror() -> Mirror {
-		return Mirror(self, children: [
-			"embed": "\(T.self) -> \(U.self)",
-			"project": "\(U.self) -> \(T.self)",
-			"currentMap": self.table,
-		])
-	}
-}
-
+private final class PointerOfImpl<T : Arbitrary> : Arbitrary {
+	var ptr : UnsafeMutablePointer<T>
+	let size : Int
+
+	var description : String {
+		return "\(self.ptr)"
+	}
+
+	init(_ ptr : UnsafeMutablePointer<T>, _ size : Int) {
+		self.ptr = ptr
+		self.size = size
+	}
+
+	deinit {
+		if self.size > 0 && self.ptr != nil {
+			self.ptr.dealloc(self.size)
+			self.ptr = nil
+		}
+	}
+
+	static var arbitrary : Gen<PointerOfImpl<T>> {
+		return Gen.sized { n in
+			if n <= 0 {
+				return Gen.pure(PointerOfImpl(nil, 0))
+			}
+			let pt = UnsafeMutablePointer<T>.alloc(n)
+			let gt = pt.initializeFrom <^> sequence(Array((0..<n)).map { _ in T.arbitrary })
+			return gt.fmap { _ in PointerOfImpl(pt, n) }
+		}
+	}
+}
+

				})
			})
		}
	}
}

extension ArrowOfImpl : CustomReflectable {
	func customMirror() -> Mirror {
		return Mirror(self, children: [
			"types": "\(T.self) -> \(U.self)",
			"currentMap": self.table,
		])
	}
}


}

/// Generates pointers of varying size of random values of type T.
public struct PointerOf<T : Arbitrary> : Arbitrary, CustomStringConvertible {
	private let _impl : PointerOfImpl<T>

	public var getPointer : UnsafePointer<T> {
		return UnsafePointer(self._impl.ptr)
	}

	public var size : Int {
		return self._impl.size
	}

	public var description : String {
		return self._impl.description
	}

	public static var arbitrary : Gen<PointerOf<T>> {
		return PointerOfImpl.arbitrary.fmap(PointerOf.init)
	}
}

