1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00
srs/trunk/research/gperftools/memory.error.notcmalloc.cpp
2017-03-25 17:21:39 +08:00

16 lines
310 B
C++

/**
g++ memory.error.notcmalloc.cpp -g -O0 -o memory.error.notcmalloc
*/
#include <unistd.h>
#include <string.h>
#include <stdio.h>
void foo(char* p){
memcpy(p, "01234567890abcdef", 16);
}
int main(int argc, char** argv){
char* p = new char[10];
foo(p);
printf("p=%s\n", p);
return 0;
}