1 /**
2 * Implementation of array copy support routines.
3 *
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 src/rt/_arraycat.d)
9 */
10
11 module rt.arraycat;
12
13 private
14 {
15 import core.stdc.string;
16 import rt.util.array;
17 debug(PRINTF) import core.stdc.stdio;
18 }
19
20 extern (C) @trusted nothrow:
21
_d_arraycopy(size_t size,void[]from,void[]to)22 void[] _d_arraycopy(size_t size, void[] from, void[] to)
23 {
24 debug(PRINTF) printf("f = %p,%d, t = %p,%d, size = %d\n",
25 from.ptr, from.length, to.ptr, to.length, size);
26
27 enforceRawArraysConformable("copy", size, from, to);
28 memcpy(to.ptr, from.ptr, to.length * size);
29 return to;
30 }
31