 	/// - parameter block: A string comparison function
 	/// - throws: `DatabaseError`
 	public func add(collation name: String, _ block: @escaping StringComparator) throws {
-		let storage = UnsafeMutablePointer<StringComparator>.allocate(capacity: 1)
-		storage.initialize(to: block)
-		guard sqlite3_create_collation_v2(db, name, SQLITE_UTF8, storage, { (context, lhs_len, lhs_data, rhs_len, rhs_data) -> Int32 in
+		let function_ptr = UnsafeMutablePointer<StringComparator>.allocate(capacity: 1)
+		function_ptr.initialize(to: block)
+		guard sqlite3_create_collation_v2(db, name, SQLITE_UTF8, function_ptr, { (context, lhs_len, lhs_data, rhs_len, rhs_data) -> Int32 in
 			// Have total faith that SQLite will pass valid parameters and use unsafelyUnwrapped
 			let lhs = String(bytesNoCopy: UnsafeMutableRawPointer(mutating: lhs_data.unsafelyUnwrapped), length: Int(lhs_len), encoding: .utf8, freeWhenDone: false).unsafelyUnwrapped
 			let rhs = String(bytesNoCopy: UnsafeMutableRawPointer(mutating: rhs_data.unsafelyUnwrapped), length: Int(rhs_len), encoding: .utf8, freeWhenDone: false).unsafelyUnwrapped
 
 			// Cast context to the appropriate type and call the comparator
-			let result = context.unsafelyUnwrapped.assumingMemoryBound(to: StringComparator.self).pointee(lhs, rhs)
+			let function_ptr = context.unsafelyUnwrapped.assumingMemoryBound(to: StringComparator.self)
+			let result = function_ptr.pointee(lhs, rhs)
 			return Int32(result.rawValue)
 		}, { context in
-			let storage = context.unsafelyUnwrapped.assumingMemoryBound(to: StringComparator.self)
-			storage.deinitialize()
-			storage.deallocate(capacity: 1)
+			let function_ptr = context.unsafelyUnwrapped.assumingMemoryBound(to: StringComparator.self)
+			function_ptr.deinitialize()
+			function_ptr.deallocate(capacity: 1)
 		}) == SQLITE_OK else {
 			throw DatabaseError.sqliteError(String(cString: sqlite3_errmsg(db)))
 		}

		}
	}
}

	}
}

/// A comparator for `String` objects
///
/// - parameter lhs: The left-hand operand
/// - parameter rhs: The right-hand operand
/// - returns: The result of comparing `lhs` to `rhs`
public typealias StringComparator = (_ lhs: String, _ rhs: String) -> ComparisonResult

/// Custom collation support
extension Database {
