Changeset df3c6f02 in mainline for uspace/app/tester/mm/malloc2.c


Ignore:
Timestamp:
2011-05-31T22:58:56Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d362410
Parents:
82582e4 (diff), 4ce90544 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/mm/malloc2.c

    r82582e4 rdf3c6f02  
    11/*
    2  * Copyright (c) 2009 Martin Decky
     2 * Copyright (c) 2011 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #include <test.h>
     29#include <stdio.h>
     30#include <unistd.h>
     31#include <stdlib.h>
     32#include <malloc.h>
     33#include "../tester.h"
    3034
    31 const char *test_fpu1(void)
     35const char *test_malloc2(void)
    3236{
     37        int cnt = 0;
     38        char *p;
     39
     40        TPRINTF("Provoking the kernel into overcommitting memory to us...\n");
     41        while ((p = malloc(1024 * 1024))) {
     42                TPRINTF("%dM ", ++cnt);
     43                *p = 'A';
     44        }
     45        TPRINTF("\nWas refused more memory as expected.\n");
     46
    3347        return NULL;
    3448}
Note: See TracChangeset for help on using the changeset viewer.