1. EU 2.2: allocate() bug?
Hi Rob, under WinNT in the CMD-window I fail with the following
program:
(By the way, I find still only 64MB RAM under DOS, whereas Devore Software
promised more than that now!)
------------------------------------------------------------------------------
-- Rolf Schröder 1999-12-27
--> ALLOCW.EXW Allocate as much RAM as possible! Möörkenweg 37
-- ¯¯¯¯¯¯¯¯¯¯ 21029 Hamburg, Germany
-- Language: EUPHORIA ver. 2.2 r.schr at t-online.de
------------------------------------------------------------------------------
include get.e -- wait_key()
include machine.e -- allocate()
include misc.e -- WIN32
------------------------------------------------------------------------------
constant MB = power(2,20) -- 1 MegaByte
constant B = #FF -- 1 Byte, all bits set
------------------------------------------------------------------------------
procedure main()
-- ¯¯¯¯
atom a
integer n
puts(1,"Allocate and fill as much RAM as possible!\n")
puts(1," (press any key to stop)\n\n")
for i = 256 to 16 by -16 do
n = i * MB
a = allocate(n)
if a then
printf(1,"%5dMB = not allocateble!\n",i)
else
mem_set(a, B, n)
printf(1,"%5dMB = %10d Bytes allocatet!\n", {i,n})
free(a)
exit
end if
if get_key() != -1 then
puts(1,"Program aborted by user.\n")
exit
end if
end for
if platform() = WIN32 then
puts(1," ..press any key..")
n = wait_key()
end if
abort(0)
end procedure
------------------------------------------------------------------------------
main()
------------------------------------------------------------------------------
2. Re: EU 2.2: allocate() bug?
Rolf Schroeder writes:
> Hi Rob, under WinNT in the CMD-window I fail with the
> following program:
> a = allocate(n)
> if a then <-- Your test should be: if a = 0 then ...
> printf(1,"%5dMB = not allocateble!\n",i)
> else
> mem_set(a, B, n)
> printf(1,"%5dMB = %10d Bytes allocatet!\n", {i,n})
> free(a)
> exit
> end if
allocate() returns 0 when it can't find enough space.
Your if-condition should be:
if a = 0 then
... -- not enough space
> (By the way, I find still only 64MB RAM under DOS, whereas
> Devore Software promised more than that now!)
I hope you didn't use the above program
to test this. I must confess I don't have a machine with
more than 64Mb RAM. I just took Devore Software's
word for it.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
3. Re: EU 2.2: allocate() bug?
Robert Craig wrote:
> allocate() returns 0 when it can't find enough space.
> Your if-condition should be:
> if a = 0 then
> ... -- not enough space
>
Sch.. . It was on the 25th of Dec. and obviously I used to much Burgundy for
programming! Well, I mixed up the content in the if..else..end if -statement.
> I hope you didn't use the above program
> to test this.
Why not?
> I must confess I don't have a machine with
> more than 64Mb RAM. I just took Devore Software's
> word for it.
But it's true: there is still the 64MB-limit under DOS32 on my machine with 256
MB.
By the way: do you (or someone else) know how to avoid the use of virtual
memory for a program running unter NT?
Have a nice day and thanks, Rolf
4. Re: EU 2.2: allocate() bug?
Rob Craig writes:
>> I hope you didn't use the above program
>> to test this.
Rolf writes
>Why not?
I just hoped that the bug in the above program,
didn't somehow lead you to incorrectly believe that there was
still a 64Mb limit under DOS.
> But it's true: there is still the 64MB-limit under DOS32 on my
> machine with 256 MB.
Maybe CauseWay will give you more than
64Mb, but not all in one huge contiguous piece of memory.
> By the way: do you (or someone else) know how to avoid
> the use of virtual memory for a program running unter NT?
Under plain DOS you can say:
SET CAUSEWAY=NOVM
but I don't know how to prevent virtual memory from
being used under Windows.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
5. Re: EU 2.2: allocate() bug?
I thought you did that in controle panel
Http://members.tripod.com/ka9qlq/ka9qlq.html
----- Original Message -----
From: Robert Craig <rds at ATTCANADA.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Tuesday, December 28, 1999 5:22 PM
Subject: Re: EU 2.2: allocate() bug?
> Rob Craig writes:
> >> I hope you didn't use the above program
> >> to test this.
> Rolf writes
> >Why not?
>
> I just hoped that the bug in the above program,
> didn't somehow lead you to incorrectly believe that there was
> still a 64Mb limit under DOS.
>
> > But it's true: there is still the 64MB-limit under DOS32 on my
> > machine with 256 MB.
>
> Maybe CauseWay will give you more than
> 64Mb, but not all in one huge contiguous piece of memory.
>
> > By the way: do you (or someone else) know how to avoid
> > the use of virtual memory for a program running unter NT?
>
> Under plain DOS you can say:
>
> SET CAUSEWAY=NOVM
>
> but I don't know how to prevent virtual memory from
> being used under Windows.
>
> Regards,
> Rob Craig
> Rapid Deployment Software
> http://www.RapidEuphoria.com
>