Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

real mode memory management question (Developers)

posted by Rugxulo Homepage, Usono, 25.08.2008, 03:53

> It's a bit strange. Initially I can malloc 500 * 1024 (and also 650 * 1024
> which would be 650 KB) and later in the loop it breakes after 59 * 1024
> (which should be only 59 KB) due to malloc error.

(Note: I don't really know C++, so take this with a grain of salt.)

Why are you using long double to define how much you want? Floats / doubles are always stored differently. Plus, you're mixing C malloc() with C++ stuff instead of using new / delete (why?). Anyways, at least DJGPP (for example) won't malloc() any mem until you actually need it, unlike calloc().

P.S. Try asking in openwatcom.users.c_cpp if none of us can help.

EDIT: 650k should never work (else you're doing something VERY weird).

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 128 users online (0 registered, 128 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum