aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/alloc/allocate_and_core.cpp
blob: 5d0af33845dc78580e0fc5375ceac89de5a1321c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/util/alloc.h>
#include <string.h>
#include <cassert>

using namespace vespalib::alloc;

int main(int argc, char *argv[]) {
    (void) argc;
    (void) argv;
    Alloc small(Alloc::allocMMap(0x400000)); //4M
    memset(small.get(), 0x55, small.size());
    Alloc large(Alloc::allocMMap(0x4000000)); //640M
    memset(large.get(), 0x66, large.size());
    assert(false);
}