xref: /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/rt/arraycat.d (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1181254a7Smrg /**
2181254a7Smrg  * Implementation of array copy support routines.
3181254a7Smrg  *
4181254a7Smrg  * Copyright: Copyright Digital Mars 2004 - 2016.
5181254a7Smrg  * License:   Distributed under the
6181254a7Smrg  *            $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
7181254a7Smrg  * Authors:   Walter Bright, Sean Kelly
8*b1e83836Smrg  * Source:    $(DRUNTIMESRC rt/_arraycat.d)
9181254a7Smrg  */
10181254a7Smrg 
11181254a7Smrg module rt.arraycat;
12181254a7Smrg 
13181254a7Smrg private
14181254a7Smrg {
15181254a7Smrg     import core.stdc.string;
16*b1e83836Smrg     import core.internal.util.array;
17181254a7Smrg     debug(PRINTF) import core.stdc.stdio;
18181254a7Smrg }
19181254a7Smrg 
20181254a7Smrg extern (C) @trusted nothrow:
21181254a7Smrg 
_d_arraycopy(size_t size,void[]from,void[]to)22181254a7Smrg void[] _d_arraycopy(size_t size, void[] from, void[] to)
23181254a7Smrg {
24181254a7Smrg     debug(PRINTF) printf("f = %p,%d, t = %p,%d, size = %d\n",
25181254a7Smrg                  from.ptr, from.length, to.ptr, to.length, size);
26181254a7Smrg 
27181254a7Smrg     enforceRawArraysConformable("copy", size, from, to);
28181254a7Smrg     memcpy(to.ptr, from.ptr, to.length * size);
29181254a7Smrg     return to;
30181254a7Smrg }
31