How malloc() and sbrk() works in unix?

前端 未结 4 799
别跟我提以往
别跟我提以往 2021-02-13 10:58

I am new to UNIX, and I am studying some of UNIX system calls such as brk(), sbrk(), and so on....

Last day I have read about malloc()

4条回答
  •  无人及你
    2021-02-13 11:35

    malloc() function is used to call the sbrk system call to create a memory dynamically during the process.

    malloc() function is already assigned in stdlib.h header file so the as per the required function is recursively call by the malloc function using the library function.

    with the help of sbrk we need to explicitly declare some thing to call the system call.

    According to the size given in function or through system call it return to the variable and store.

提交回复
热议问题