• 此项目
    • 正在载入...
  • Sign in

胡斌 / srs

96x96
转到一个项目
Toggle navigation
  • 项目
  • 群组
  • 代码片段
  • 帮助
Toggle navigation pinning
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • srs
  • trunk
  • research
  • gperftools
  • memory.error.notcmalloc.cpp
  • support gmd. change work_dir. hourglass. add utilies. · f1e7e9d9
    f1e7e9d9 浏览文件
    winlin authored 2016-01-08 13:58:19 +0800
memory.error.notcmalloc.cpp 308 字节
原文件 审查 历史 永久链接
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/**
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;
}