aboutsummaryrefslogtreecommitdiffstats
path: root/vespamalloc/src/vespamalloc/malloc/independent_non_inlined_memcpy.cpp
blob: 955e901581c10a3bd45f29c273f652402eacf078 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "independent_non_inlined_memcpy.h"

namespace vespamalloc {

// Simple memcpy replacement to avoid calling code in other dso.
// No dependencies to other libraries are allowed here.
void
independent_non_inlined_memcpy(void * dest_in, const void * src_in, size_t n) {
    char *dest = static_cast<char *>(dest_in);
    const char *src = static_cast<const char *>(src_in);
    for (size_t i(0); i < n ; i++) {
        dest[i] = src[i];
    }
}

}