diff options
author | Zoltan Varga <vargaz@gmail.com> | 2013-06-11 01:01:32 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-06-11 01:10:34 +0400 |
commit | 31bf37d6d4e1d440b9fd176a8391bd471411dfb3 (patch) | |
tree | d78d8137cf62cd76d300651fcaf31ec41988b935 /mcs | |
parent | 23171bc45777dac2a20ff8336ff42b3b5b2e4b21 (diff) |
Add specialized memcpy/bzero methods to String which are called from gsharedvt code.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System/String.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs index 937b9214582..8bb492d8d65 100644 --- a/mcs/class/corlib/System/String.cs +++ b/mcs/class/corlib/System/String.cs @@ -3081,6 +3081,43 @@ namespace System memcpy4 (dest, src, size); } + /* Used by the runtime */ + internal static unsafe void bzero (byte *dest, int len) { + memset (dest, 0, len); + } + + internal static unsafe void bzero_aligned_1 (byte *dest, int len) { + ((byte*)dest) [0] = 0; + } + + internal static unsafe void bzero_aligned_2 (byte *dest, int len) { + ((short*)dest) [0] = 0; + } + + internal static unsafe void bzero_aligned_4 (byte *dest, int len) { + ((int*)dest) [0] = 0; + } + + internal static unsafe void bzero_aligned_8 (byte *dest, int len) { + ((long*)dest) [0] = 0; + } + + internal static unsafe void memcpy_aligned_1 (byte *dest, byte *src, int size) { + ((byte*)dest) [0] = ((byte*)src) [0]; + } + + internal static unsafe void memcpy_aligned_2 (byte *dest, byte *src, int size) { + ((short*)dest) [0] = ((short*)src) [0]; + } + + internal static unsafe void memcpy_aligned_4 (byte *dest, byte *src, int size) { + ((int*)dest) [0] = ((int*)src) [0]; + } + + internal static unsafe void memcpy_aligned_8 (byte *dest, byte *src, int size) { + ((long*)dest) [0] = ((long*)src) [0]; + } + internal static unsafe void CharCopy (char *dest, char *src, int count) { // Same rules as for memcpy, but with the premise that // chars can only be aligned to even addresses if their |