flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [query] Memory requirements

Author
Thread Post new topic Reply to topic
Chewy509



Joined: 19 Jun 2003
Posts: 297
Location: Bris-vegas, Australia
Chewy509
I was just wandering how fasm allocates the default memory pool when assembly a file.

The b0 compiler source, has now grown to about 750KB+ in size, and am finding that depending on the target platform and OS that is building the compiler, fasm reports out of memory...

eg.
FreeBSD/AMD64 (fasm is the libc version, linked to the local 32bit libc), 2GB RAM, out of memory error on all builds.
Windows XP x64, 2GB RAM, all builds are fine.
Windows XP SP2, 1GB RAM, libc-version builds fine, native compilers (eg Win64, FreeBSD, Linux) get an out of memory error.

I've tried playing with the -m option, and that fails. (Sometimes allocates less than specified, but know that's because of how fasm does the initial pool allocation, with the 1/2 rule on an allocation fail).

I'm using fasm 1.67.21 on all platforms. Source files which I'm attempting to assemble are attached.

Can someone shed some light on what's happening and why?

PS. B0 can build itself as libc-linked, Linux native, Windowsx64 native or FreeBSD native. 99% of the code is shared between all the builds, and there are at most 4 passes to assemble the final object file.


Description:
Download
Filename: b0.zip
Filesize: 153.75 KB
Downloaded: 124 Time(s)

Post 08 Jun 2007, 02:43
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
Chewy509 wrote:
I was just wandering how fasm allocates the default memory pool when assembly a file.


the problem is on instructions like:
rb 526014728
rb 10000000h

so you like bloatware?
Post 08 Jun 2007, 07:35
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
perhaps it would be a good idea that fasm outputs the line number also for fatal errors, i modified a litle the fasm sources to output info like in a non fatal error to find where the problem was.
Post 08 Jun 2007, 08:06
View user's profile Send private message Visit poster's website Reply with quote
Chewy509



Joined: 19 Jun 2003
Posts: 297
Location: Bris-vegas, Australia
Chewy509
Octavio wrote:
Chewy509 wrote:
I was just wandering how fasm allocates the default memory pool when assembly a file.


the problem is on instructions like:
rb 526014728
rb 10000000h

so you like bloatware?

Yep, the current b0 compiler has a little bloat? However just because the app wants to allocation 512MB+ in the bss at startup, is the apps problem... Wink

However why would fasm crap out with such requests? Does fasm actually allocate those structures in memory, even though they are virtual in nature?

I can understand if the 'rb' are within the 'data' section (since fasm would allocate the actual space in memory before writing to file), but in the case of the ELF/ELFO generated files, they are within the 'bss' section? (Yep, I do need to fix up the PE/DLL formats).

PS. I am looking at redoing some of the b0 compiler internals to be more memory friendly.
PPS. What's the default bss section name for PE and DLL files?
Post 12 Jun 2007, 00:05
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.