Article View: comp.os.os2.programmer
Article #3447Re: malloc() and swapper.dat problems ....
From: Takis Skagos
Date: Mon, 11 Jan 1993 22:13
Date: Mon, 11 Jan 1993 22:13
29 lines
1249 bytes
1249 bytes
In article <1993Jan10.200412.454149@sue.cc.uregina.ca> skagos@mercury.cs.uregina.ca (Takis Skagos) writes:
>
>#include <stdio.h>
>
>main()
>{
> int k = 0;
> int *p;
> setbuf(stdout,NULL); setbuf(stdin,NULL);
> p = (int *) malloc(12000000); /* bytes */
> printf("\n malloced 12000000 bytes.");
> while(k < 10000000 )
> {
> p[k] = 1;
> k++;
> if(k % 10000 == 0)
> putchar('.');
> }
> free(p);
> printf("\n freed 12000000 bytes.\n");
>}
>
Yes ... I AM A FOOL! Integers are 4 bytes! UGH! I hate it when I
do these silly mistakes. Oh well. It should read something like
"while (k < 3000000)". UGH!
P. Takis Skagos
(skagos@cs.uregina.ca)
Technical Details
Message-ID:
<1993Jan11.221309.519253@sue.cc.uregina.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!utcsri!newsflash.concordia.ca!mizar.cc.umanitoba.ca!access.usask.ca!sue!mercury.cs.uregina.ca!skagosReferences:
<1ipnriINNsm5@im4u.cs.utexas.edu> <1993Jan10.200412.454149@sue.cc.uregina.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!newsflash.concordia.ca!mizar.cc.umanitoba.ca!access.usask.ca!sue!mercury.cs.uregina.ca!skagos From: skagos@mercury.cs.uregina.ca (Takis Skagos) Subject: Re: malloc() and swapper.dat problems .... Sender: news@sue.cc.uregina.ca Message-ID: <1993Jan11.221309.519253@sue.cc.uregina.ca> Date: Mon, 11 Jan 1993 22:13:09 GMT References: <1ipnriINNsm5@im4u.cs.utexas.edu> <1993Jan10.200412.454149@sue.cc.uregina.ca> Organization: University of Regina, SK, Canada Lines: 30