/** * \file * \brief process that allocates some memory to test page faulting and page mapping */ /* * Copyright (c) 2016, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #include #include #include #include int main(int argc, char *argv[]) { //allocate a 256 byte buffer // char * small_buf = malloc(256); // small_buf[0] = 'a'; //allocate a 256 MiB buffer char * big_buf = malloc(1<<28); big_buf[0] = 'a'; for (int i = 0; i < (1 << 16); i += 4096) { debug_printf("%x\n", i); big_buf[i] = 'b'; } }