Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,509 of 4,255    |
|    Alexei A. Frounze to muta...@gmail.com    |
|    Re: malloc with small data    |
|    26 Nov 22 23:04:00    |
      From: alexfrunews@gmail.com              On Thursday, November 24, 2022 at 1:19:48 AM UTC-8, muta...@gmail.com wrote:       > How did people support malloc() requests in the       > tiny/small/medium memory models?       >       > Did the executable in the header ask for memory       > beyond SP, perhaps filling out to the 64k boundary,       > and then at startup, see how much memory you       > managed to get, and only release stuff above the       > 64k boundary, and then service malloc requests       > from within that space?       >       > Currently in PDPCLIB I only support malloc for       > compact/large/huge and go directly to the OS       > to obtain it rather than link in my own memory       > management routines.              Tiny memory model .COMs get all the memory, which can be less       or more than 64KB. I simply resize the block to 64KB and move SP       to its end (if the resizing fails, the .COM terminates with error).       The library manages the heap space between the static       variables and the stack.       My small memory model .EXEs don't resize anything as they       always get the minimum specified in the header, which is       set to a value that guarantees a full 64KB data/stack segment.       The library manages the heap space the same way.              Alex              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca