flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > fasm to use self indulged virtual memory?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 20 Oct 2010, 12:15
It would be nice if fasm could create temporary file for subsidiary use when it runs out of memory.
(Thus having two memory settings)
Post 20 Oct 2010, 12:15
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 20 Oct 2010, 12:21
What for?
Post 20 Oct 2010, 12:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20421
Location: In your JS exploiting you and your system
revolution 20 Oct 2010, 12:30
guignol wrote:
It would be nice if fasm could create temporary file for subsidiary use when it runs out of memory.
(Thus having two memory settings)
It already does.

Well not directly anyway, the OS will do it. In Windows it is called pagefile.sys. In other OSes it is probably called something else. But that is what virtual memory is -- a file on disk for times when RAM is insufficient.

Use the "-m" switch to reserve however much memory you want. But remember that it is a 32-bit application and is limited to ~2GB-4GB maximum (exact amount depends upon the OS you are using).
Post 20 Oct 2010, 12:30
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 20 Oct 2010, 14:53
revolution,

External storage (in general case) allows to use much larger buffer for preprocessed source (which is the main problem, as I see it). Simple source with include "Win32AX.Inc" can grow quite fast with each macro used (EXAMPLES\HELLO.ASM is almost 3.5 MiB preprocessed, +1.7k for each extra invoke, +7k for each .if/.while/.repeat).

Am I the only one that thought about "compile something useful & readable using fasm -m 1024" contest? fasm compiles in 4 MiB, but is its source readable for anybody except Tomasz? Wink
Post 20 Oct 2010, 14:53
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 20 Oct 2010, 15:37
fool/shell.asm compiles with exactlly 2519 kilobytes, no more needed.

and is not usefull, then, it is out of the discution.

but using an external storage for fasm memory can be interrseting, but only for fasm debugging.

for applications, only the listing is usefull to detect the problems, and it is effectivelly a file generated via .fas file, internally generated by fasm.
Post 20 Oct 2010, 15:37
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20421
Location: In your JS exploiting you and your system
revolution 20 Oct 2010, 20:37
I understand the memory problem. I really do. Since in the past I have regularly run out of memory. But now I have developed most of my macros to use a lot less memory.

But I have to ask this: Does anyone here actually have source code that needs more than 2GB of memory to compile? Or is this just an academic discussion? And I am not talking about some trivial source file of repeated nonsense made just to test the system.

Should we be expecting fasm to ever be able to compile this?
Code:
times 1 shl 40 nop    
Post 20 Oct 2010, 20:37
View user's profile Send private message Visit poster's website Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 21 Oct 2010, 00:14
rev, go punch FASMARM developer for a new version, and don't bother.
This is no Heap and noone's asking for your "suggestions".

baldr, it is, though you're right Tomasz did intentionally not put comments in it.
Post 21 Oct 2010, 00:14
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Oct 2010, 00:26
And what about me? Smile

I still can't understand for what reason you want such behavior.
Post 21 Oct 2010, 00:26
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20421
Location: In your JS exploiting you and your system
revolution 21 Oct 2010, 01:01
guignol: You want Tomasz to include a new function, as shown by your topic here. But you offer no justification for including it. vid already gave you the hint in his first reply, but you ignored it. So I asked specifically for what code you need this functionality, which you also ignored (and merely attack in response). But in reality if you still want Tomasz to include something like this for you then you need to explain why it is needed. Else what incentive is there for Tomasz to put in all the work involved with doing it?

My 'suggestion' to you is to explain the reason for it. If you have a clear use for it then Tomasz might view it as important and start working on it. My 'suggestion' is here to help you to achieve what you want, not to work against you.
Post 21 Oct 2010, 01:01
View user's profile Send private message Visit poster's website Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 21 Oct 2010, 02:02
(She is a girl)


vid, don't take me too much wrong... but "so what?"
You see, from where I perceive it, you sound like that chatterbox mentioned above.


After all, isn't it enough that I will appreciate it? Very Happy
Post 21 Oct 2010, 02:02
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 21 Oct 2010, 09:17
More than 4 GB of memory? That would, of course, require upgrading all the pointers to larger sizes. Thus it may as well end as rewriting fasm for x86-64 architecture. Which is not a bad idea itself, but has nothing to do with writing own virtual memory handling, as that idea deserves exactly the vid's initial response.
Post 21 Oct 2010, 09:17
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Oct 2010, 11:29
Quote:
After all, isn't it enough that I will appreciate it?

What do you think? Would the fact that "guignol shall appreciate that" be enough to convince Tomasz to implement this feature?
Post 21 Oct 2010, 11:29
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 21 Oct 2010, 13:22
Tomasz, define "virtual memory"? Smile
I wasn't talking about virtual memory from OS perspective.

Let's say, for starters, that preprocessor tokens would be treated into that subsidiary file, thus freeing actual memory.


P.S. Do I really need to read all fasm source to tell where those two can be divided?


Last edited by guignol on 21 Oct 2010, 13:54; edited 1 time in total
Post 21 Oct 2010, 13:22
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 21 Oct 2010, 13:36
guigno wrote:
define "virtual memory"?
http://en.wikipedia.org/wiki/Virtual_memory

guignol wrote:
Let's say, for starters, that preprocessor tokens would be treated into that subsidiary file, thus freeing actual memory.
The pointers into preprocessed source would still be 32-bit offsets. So you would be still left with 4G limit for it.
Post 21 Oct 2010, 13:36
View user's profile Send private message Visit poster's website Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 21 Oct 2010, 13:53
Tomasz wrote:
The pointers into preprocessed source would still be 32-bit offsets. So you would be still left with 4G limit for it.
This is not the point.
The point is that anything that can be treated out of actual physical memory be possible to be done with so.
Post 21 Oct 2010, 13:53
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 21 Oct 2010, 13:58
If I write it to file, it is actually quite probable, that OS will keep it in cache, so it will stay in physical memory anyway - especially since the preprocessed source is "randomly" accessed by all of the later stages.
Post 21 Oct 2010, 13:58
View user's profile Send private message Visit poster's website Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 21 Oct 2010, 14:46
Tomasz
Cache?
So FreeMemory actually caches it?
Post 21 Oct 2010, 14:46
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 21 Oct 2010, 16:32
guignol,

Without FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING every file access goes through cache manager.

FreeMemory — what is it? Turbo Pascal/Delphi procedure? Then it has nothing to do with Windows memory management.
Post 21 Oct 2010, 16:32
View user's profile Send private message Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 21 Oct 2010, 17:40
baldr
No, I misread Tomasz:
Tomasz wrote:
If I write it to file, it is actually quite probable, that OS will keep it in cache, so it will stay in physical memory anyway

(That's why I was so buggy about proper language usage Wink)


Ok, so what's wrong with using file directly (without caching/mapping it into memory)?
Post 21 Oct 2010, 17:40
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Oct 2010, 19:38
Quote:
Ok, so what's wrong with using file directly (without caching/mapping it into memory)?

There is no reason to do it.
Post 21 Oct 2010, 19:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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.