flat assembler
Message board for the users of flat assembler.

Index > Linux > Malloc: what is SysCall analog for malloc?

Author
Thread Post new topic Reply to topic
narada



Joined: 15 Feb 2008
Posts: 77
Location: Ukraine, Dnepropetrovsk
narada 13 Apr 2009, 16:13
As i see, fasm uses syscall#45 to get memory, but in my sources #45==Sys_Brk...

Can anybody help me with this...


Description: Syscalls... from my sources... no malloc founded(((
Download
Filename: syscalls.inc
Filesize: 6.68 KB
Downloaded: 543 Time(s)


_________________
http://www.omegicus.com
Post 13 Apr 2009, 16:13
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder 13 Apr 2009, 17:36
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:52; edited 1 time in total
Post 13 Apr 2009, 17:36
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 13 Apr 2009, 18:26
There is no one actually, if you malloc twice and then dealloc the first malloc you can't SYS_BRK to free without first moving the memory block of the second allocation to the beginning.

You have to implement the memory heap yourself, libc does that way.

Then you have the change of using SYS_MMAP2 which is kinda Windows' VirtualAlloc but extended to support even more (like CreateFileMapping+MapViewOfFile).
Post 13 Apr 2009, 18:26
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 13 Apr 2009, 19:18
Post 13 Apr 2009, 19:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
narada



Joined: 15 Feb 2008
Posts: 77
Location: Ukraine, Dnepropetrovsk
narada 13 Apr 2009, 19:23
thanks )
Post 13 Apr 2009, 19:23
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
narada



Joined: 15 Feb 2008
Posts: 77
Location: Ukraine, Dnepropetrovsk
narada 13 Apr 2009, 20:13
P.S. sys_brk is ok, becouse I need only 1 buffer for crypt/decrypt.
Post 13 Apr 2009, 20:13
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.