flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Linux > How to allocate memory in Linux dynamically (like malloc) | 
| Author | 
 | 
| Endre 10 Feb 2005, 12:11 You have an excellent example: Take a look into the source of fasm. You will find it. | |||
|  10 Feb 2005, 12:11 | 
 | 
| Tomasz Grysztar 10 Feb 2005, 12:18 It's syscall 45, called sys_brk, which resizes the memory block allocated for your program (the program resides on the bottom of this block, and with sys_brk you just move the top of it). | |||
|  10 Feb 2005, 12:18 | 
 | 
| Dryobates 10 Feb 2005, 16:11 sys_brk is old style. Now it's preffered sys_mmap with anon mapping. | |||
|  10 Feb 2005, 16:11 | 
 | 
| Tomasz Grysztar 10 Feb 2005, 16:21 However brk syscall is common for the Linux and all BSD systems (I'm not sure about BeOS), so I preferred it. | |||
|  10 Feb 2005, 16:21 | 
 | 
| Ton 10 Feb 2005, 16:52 Thanks for the pointers. Iĺl give it a try.
 -- Ton | |||
|  10 Feb 2005, 16:52 | 
 | 
| scientica 11 Feb 2005, 12:48 there's also malloc and free in linux    try: man 3 malloc | |||
|  11 Feb 2005, 12:48 | 
 | 
| Dryobates 11 Feb 2005, 22:08 scientica wrote: there's also malloc and free in linux But then he need link with libc... | |||
|  11 Feb 2005, 22:08 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.