写入堆内存时调用的系统调用 [英] System call invoked when writing into a heap memory

查看:32
本文介绍了写入堆内存时调用的系统调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于malloc sbrk,我知道被调用的系统调用是什么,类似地,当我写入槌状内存(堆内存)时,系统调用的是什么

I know for malloc sbrk is the system call invoked ,Similarly What is the system cal invoked when i write to a malloed memory(heap memory)

int main

{

  /* 10 byte of heap memory allocated */
  char *ptr = malloc(5);


  ptr[0] = 10;  // **What is the system call invoked for 
                    writing into this heap memory** ?????


}

推荐答案

在这种情况下,不涉及系统调用.请您的编译器生成程序集,以便您可以看到那里只有一些MOV指令.或者您可以使用调试器查看程序集

There are no system call involved in this case. Ask you compiler to generate assembly so that you can see that there is only some MOV instructions there. Or you can use a debugger to see the assembly

这篇关于写入堆内存时调用的系统调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆