home *** CD-ROM | disk | FTP | other *** search
- /* Resource Tracking
- ** -----------------
- ** This program tests the resource tracking of GMS. It will attempt to
- ** allocate 100 sets of 10k and then exit without freeing them. GMS will
- ** respond with a warning and will free all the memory that was allocated.
- **
- */
-
- #include <proto/exec.h>
- #include <proto/games.h>
- #include <stdio.h>
-
- struct GMSBase *GMSBase;
-
- struct Keys GameKeys;
-
- void main(void)
- {
- char key;
- int i;
-
- GMSBase = (struct GMSBase *) OpenLibrary("games.library", 0);
-
- printf("Resource Tracking\n");
- printf("-----------------\n");
- printf("This program tests the resource tracking of GMS. It will attempt to\n");
- printf("allocate 100 blocks of 10k and then exit without freeing them. GMS will\n");
- printf("respond with a warning and will free all the memory that was allocated.\n");
- printf("\nPress the return key to start.\n\n");
-
- scanf("%c",&key);
-
- printf("Attempting to allocate 100 blocks of 10k...\n\n");
-
- for (i=0; i<100; i++)
- AllocMemBlock(10000,MEM_ANY);
-
- printf("Closing down...\n\n");
-
- CloseLibrary((struct Library *)GMSBase);
- }
-