首页 | 本学科首页   官方微博 | 高级检索  
     

在Linux 2.6.11中进程调用malloc函数的情景分析
引用本文:郑杰,郭益林,吴爱华.在Linux 2.6.11中进程调用malloc函数的情景分析[J].电脑编程技巧与维护,2009(22):24-26,37.
作者姓名:郑杰  郭益林  吴爱华
作者单位:厦门大学,厦门,361005
摘    要:在Linux系统中用户调用malloc函数的过程实际上是一个间接调用brk函数的过程,brk函数在内核中的实现为sysbrk函数。详细探讨了Linux内核2.6.11版本中内存管理与分配的细节,重点分析了sysbrk函数的代码,并提供了do_munmap和do_brk0这两个主要的函数的流程图。sys_brk函数可以用来分配空间,即把动态分配区底部的边界往上推,也可以用来释放内存,即归还空间。因此它的代码也大致上分成两部分,对相关函数调用与流程作了详细的分析。

关 键 词:进程调用  进程空间  malloc  sys_brk  do_brk  do_munmap

The Scenario Analysis of Procedure Call of Malloc Function in Linux 2.6.11
ZHENG lie,GUO Yilin,WU Aihua.The Scenario Analysis of Procedure Call of Malloc Function in Linux 2.6.11[J].Computer Programming Skills & Maintenance,2009(22):24-26,37.
Authors:ZHENG lie  GUO Yilin  WU Aihua
Affiliation:ZHENG Jie,GUO Yilin,WU Aihua (Xiamen University,Xiamen 361005)
Abstract:User calls of the malloc function in the linux system is an indirect process of brk function, which the realization in the kernel is sys_brk function. We discusses the details of the memory management and allocation in the 2.6.11 version of linux kernel, focusing on an analysis of sys_brk function, and provides the two main flow chart of do_munmap and do_brk. Sys_brk function can be used to allocate space, that is, push up the border at the bottom of the dynamic allocation area , but also can be used to rel...
Keywords:malloc  sys_brk  do_brk  do_munmap
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号