aboutsummaryrefslogtreecommitdiff
path: root/src/base/mem/set64.c
blob: 669c70c5283ed7f51428a5f81331db9cf0240971 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "internal.h"

int
mem·set64(void *dst, uintptr size, uint64 val)
{
    intptr i;

    for(i = 0; i < (size & (~7)); i += 8)
        mem·copy((byte*)dst + i, 8, &val);

    for(; i < size; i++)
        ((byte*)dst)[i] = ((byte*)&val)[i&7];

    return 0;
}