Orlando Llanes wrote:
The question I'm about to ask pertains to the DJGPP/DOS platform, tho
it may apply to other platforms if present. How can I access mroe than 8MB while keeping compatible with the GPC Pointer type? I ask because I tried allocating >8MB and I got a runtime error saying that GPC is out of heap space. I know there are DPMI functions, but which one can allocate >8MB while still maintaining the near pointer type? Thanks in advance!
Looks like a DPMI configuration issue. I just ran the following program in DosEmu succesfully, after I increased the DPMI memory size (in DosEmu, that's as simple as setting "dpmi 32768" in /etc/dosemu.conf, but I don't know how this is done in native Dos):
program x; const m=33000000; type t=array[1..m] of byte; var a:^t; i:integer; begin new(a); for i:=1 to m do a^[i]:=i and $ff; for i:=1 to m do if a^[i]<>i and $ff then runerror(42); writeln('OK') end.
However, I can't seem to allocate more than 32 MB in DPMI, so this might be the limit of DPMI. (Anyone knows? From other source, I sometimes hear 16 MB, sometimes 64 MB as the limit. 32 MB is just in between, so according to the usual Dos kind of logic, this might be correct... >:-)
BTW, (Peter:) BP accepts "RunError" without an argument, so GPC should allow that, too. However, BP gives a "Runtime Error 0" then, which I don't like very much, since the exit status 0 usually means success. So, GPC should probably use some other error code...