So malloc doesn't invoke any syscall?

前端 未结 3 1964
感情败类
感情败类 2021-01-12 17:44

Related code:

  write(-1, \"test\", sizeof(\"test\"));
  void * p = malloc(1024);
  void * p2 = malloc(510);
  write(-1, \"hi\", sizeof(\"hi\"));
         


        
3条回答
  •  囚心锁ツ
    2021-01-12 18:49

    What do you think brk is? malloc absolutely is invoking a syscall in this example, the syscall just isn't "malloc".

提交回复
热议问题