Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
valgrind
/
663860b1408516d02ebfcb3a9999a134e6cfb223
/
.
/
main
/
memcheck
/
tests
/
static_malloc.c
blob: 22def9e86b546940056298d1f58587fe93ee748b [
file
] [
log
] [
blame
]
#include
<stdio.h>
static
char
buf
[
10000
];
static
int
bufi
=
0
;
void
*
malloc
(
size_t
i
)
{
bufi
+=
i
;
return
buf
+
bufi
-
i
;
}
void
free
(
void
*
ptr
)
{
}
int
main
(
void
)
{
char
*
p
;
p
=
malloc
(
10
);
p
=
malloc
(
123
);
free
(
p
);
return
0
;
}