~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to memcheck/tests/static_malloc.c

  • Committer: Benjamin Kerensa
  • Date: 2012-11-21 23:57:58 UTC
  • mfrom: (1.1.16)
  • Revision ID: bkerensa@ubuntu.com-20121121235758-bd1rv5uc5vzov2p6
Merge from debian unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
static char buf[10000];
 
4
static int bufi = 0;
 
5
void* malloc(size_t i) {
 
6
   bufi += i;
 
7
   return buf + bufi - i;
 
8
}
 
9
 
 
10
void free(void*ptr) {
 
11
}
 
12
 
 
13
int main (void)
 
14
{
 
15
   char *p;
 
16
   p = malloc(10);
 
17
   p = malloc(123);
 
18
   free(p);
 
19
   return 0;
 
20
}
 
21