libstdc++: Remove UB from month and weekday additions and subtractions.
[official-gcc.git] / libphobos / libdruntime / rt / arraycat.d
blobd8794809af38ab7cea6c5d4077866b12ffdd624a
1 /**
2 * Implementation of array copy support routines.
4 * Copyright: Copyright Digital Mars 2004 - 2016.
5 * License: Distributed under the
6 * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
7 * Authors: Walter Bright, Sean Kelly
8 * Source: $(DRUNTIMESRC rt/_arraycat.d)
9 */
11 module rt.arraycat;
13 private
15 import core.stdc.string;
16 import core.internal.util.array;
17 debug(PRINTF) import core.stdc.stdio;
20 extern (C) @trusted nothrow:
22 void[] _d_arraycopy(size_t size, void[] from, void[] to)
24 debug(PRINTF) printf("f = %p,%d, t = %p,%d, size = %d\n",
25 from.ptr, from.length, to.ptr, to.length, size);
27 enforceRawArraysConformable("copy", size, from, to);
28 memcpy(to.ptr, from.ptr, to.length * size);
29 return to;