Files
valgrind/memcheck/tests/static_malloc.c
Philippe Waroquiers 0ea6d36f1d fix 219156 support static malloc or alternate malloc lib (e.g. tcmalloc) with new option --soname-synonyms
* pub_tool_redir.h : define the prefix to be used for "soname synonym"
  place holder
* vg_replace_malloc.c : define synonym place holder for malloc related
  functions
* m_redir.c : when detecting a soname synonym place holder redir spec, search
  in clo_soname_synonyms if there is a synonym pattern.
  If yes, replace the soname pattern. If not, ignore the redir spec.
* various files: implement or document the new clo --soname-synonyms
* new test memcheck/tests/static_malloc.vgtest



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12559
2012-05-11 19:33:46 +00:00

22 lines
255 B
C

#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;
}