I'm looking for some good code examples of dynamic memory allocation using an assembly language under Linux and using system calls, not malloc and friends.
What are some of the simplest but effective ways to do this?
On Intel 386+ computers.
I'm looking for some good code examples of dynamic memory allocation using an assembly language under Linux and using system calls, not malloc and friends.
What are some of the simplest but effective ways to do this?
On Intel 386+ computers.
Use the brk system call to change the end of your data segment.
Take a look here: http://www.linuxjournal.com/article/6390 to understand what you're doing.
An alternative to brk()
is to use the mmap()
system call, with MAP_ANONYMOUS | MAP_PRIVATE
.