mirror of
git://sourceware.org/git/valgrind.git
synced 2026-01-19 00:08:14 +08:00
* 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
22 lines
255 B
C
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;
|
|
}
|
|
|