A special case of memcpy() that always copies memory forwards. (libc's memcpy() is allowed to copy memory backwards, and will do so when using SSSE3 instructions).

Synopsis

Declared in <folly/system/MemoryMapping.h>

void
alignedForwardMemcpy(
    void* dst,
    void const* src,
    size_t size);

Description

Assumes src and dest are aligned to alignof(unsigned long).

Useful when copying from/to memory mappings after hintLinearScan(); copying backwards renders any prefetching useless (even harmful).

Parameters

Name

Description

dst

Destination buffer, aligned to alignof(unsigned long).

src

Source buffer, aligned to alignof(unsigned long).

size

Number of bytes to copy.

Created with MrDocs