Memory Allocation for Process in Unix

Spread the love

Memory Allocation for Process in Unix Most of the persons feel that main is the function which got executed first, but before that their is one function that got called, instructions for that is added by the linker, and that function calls the main function. As part of ISO standards, signature of the main function should be

main(int argc, char **argv)

earlier defination of this is

main(int argc, char **argv, char **environ)

Why ISO removed the environ, as this is a global variable that can be accessed using the extern from any file. Their are some alternatives, to use the getenv / setenv / putenv / clearenv to get the envrionment variables. As per naming conventions, data inside these should be in Name=Value pair. Their are various memory areas those you should be aware of

  1. Text Area
  2. Initialized Data Section
  3. uninitialized Data Section
  4. Stack
  5. Heap

Details of each and every area Text Area This area is readonly, so that no one can change the instructions lying in that area, it started at fixed memory location in case of unix

2766total visits,1visits today

This entry was posted in Computers, Technical. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.