flat assembler
Message board for the users of flat assembler.
Index
> Main > Question about fasmfg mem size |
Author |
|
Tomasz Grysztar 08 Apr 2020, 15:54
The "-m" switch exists because of fasm's legacy memory manager, inherited from fasm's initial design as a tool running in flat real mode. It worked under assumption that all available physical memory would be available to use in two contiguous blocks - a smaller one with all available conventional memory, and another one with all available extended memory. These two blocks would be used by fasm's internal memory manager, which would use them both from the top and from the bottom, so they need to be pre-allocated. On systems other than DOS, when fasm cannot simply steal all of the physical memory, the size of these blocks needs to be pre-determined in some way, hence the "-m" switch.
As for the fasmg, it uses standard library malloc (or HeapAlloc in case of Windows) to dynamically allocate as much memory as it needs and therefore it cooperates better with modern systems. When porting fasmg to an OS that does not have a native malloc-like API, a custom allocator can be used, like the one that I needed for the x64 adaptation. Note that fasmg allows to optimize the allocation with use of hints that it provides by calling "malloc_fixed" or "malloc_resizable", but in all current interfaces this information is not used and these are simply aliases for the base "malloc". |
|||
08 Apr 2020, 15:54 |
|
guignol 08 Apr 2020, 16:19
Melissa wrote: I have noticed that when I reserve large chunk of data, ordinary fasm requires -m |
|||
08 Apr 2020, 16:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.