www.digitalmars.com         C & C++   DMDScript  

c++.dos.16-bits - malloc() question

reply Robert Riebisch <rr bttr-software.de> writes:
'size_t' is defined as 'unsigned' in, e.g., stdlib.h, but is it impossible
to allocate more than 32,764 bytes at once?

I found a JGE instruction in malloc's code, but why do you a signed
comparison?
Sep 18 2006
parent reply Walter Bright <newshound digitalmars.com> writes:
Robert Riebisch wrote:
 'size_t' is defined as 'unsigned' in, e.g., stdlib.h, but is it impossible
 to allocate more than 32,764 bytes at once?
 
 I found a JGE instruction in malloc's code, but why do you a signed
 comparison?

Which function did you find that in? _nmalloc?
Sep 20 2006
parent reply Robert Riebisch <rr bttr-software.de> writes:
Walter Bright wrote:

 Which function did you find that in? _nmalloc?

Probably. ;-) I didn't debug the RTL, but the generated test executable. I use the small memory model (option '-ms') and the instruction was 'call near ptr _malloc'. Hope, this helps!
Sep 21 2006
parent Robert Riebisch <rr bttr-software.de> writes:
Robert Riebisch wrote:

 Probably. ;-) I didn't debug the RTL, but the generated test
 executable. I use the small memory model (option '-ms') and the
 instruction was 'call near ptr _malloc'. Hope, this helps!

Um, still waiting... :-(
Oct 04 2006