Is it possible to make an alias on unsafe pointer type, i.e. I wanna use following: using bytePtr = System.Byte*
.
Will .net developers introduce this feature in future versions (alias to pointer and array types)?
Because any pointer could alias any other pointer in C, the compiler must assume that memory regions accessed through these pointers can overlap, which prevents many possible optimizations. C++ enables more optimizations, as pointer arguments will not be treated as possible aliases if they point to different types.
Pointer aliasing is a hidden kind of data dependency that can occur in C, C++, or any other language that uses pointers for array addresses in arithmetic operations. Array data identified by pointers in C can overlap, because the C language puts very few restrictions on pointers.
No, it isn't.
And if it was, the syntax would have been:
using BytePtr = System.Byte*;
but again: no, you can't do that. A using
alias can not be to a pointer.
Also, byte*
is both shorter and clearer than BytePtr
, IMO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With