Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
valgrind
/
00888885d88a5264711c22074cfd3462020cbee6
/
.
/
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
;
}