Use UnsafeRawPointer in StringCore.

This is another necessary step in introducing changes
for SE-0107: UnsafeRawPointer.

UnsafeRawPointer is great for bytewise pointer operations.

OpaquePointer goes away.

The _RawByte type goes away.

StringBuffer always binds memory to the correct CodeUnit
when allocating memory.

Before accessing the string, a dynamic element width check
allows us to assume the bound memory type.

Generic entry points like atomicCompareExchange no longer handle
both kinds of pointers. Normally that's good because you
should not be using generics in that case, just upcast
to raw pointer. However, with pointers-to-pointers
you can't do that.
This commit is contained in:
Andrew Trick
2016-07-26 18:28:39 -07:00
parent 3e2372b6a3
commit 9886e4ef54
12 changed files with 133 additions and 119 deletions

View File

@@ -629,16 +629,6 @@ extension UInt {
}
% end # for mutable
/// A byte-sized thing that isn't designed to interoperate with
/// any other types; it makes a decent parameter to
/// `UnsafeMutablePointer<Pointee>` when you just want to do bytewise
/// pointer arithmetic.
@_fixed_layout
public // @testable
struct _RawByte {
let _inaccessible: UInt8
}
// ${'Local Variables'}:
// eval: (read-only-mode 1)
// End: