Compare commits
No commits in common. "95c05025a4626d0ebb3c1af8134fe3c73d693dfd" and "c18f22944ec002197a3d73359e08bec4528908f1" have entirely different histories.
95c05025a4
...
c18f22944e
BIN
fast_ram_bye_bye
BIN
fast_ram_bye_bye
Binary file not shown.
@ -1,37 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <proto/exec.h>
|
|
||||||
#include <exec/memory.h>
|
|
||||||
|
|
||||||
#define RAM_SIZE (16)
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
void *FastRAM, *MoreFastRAM;
|
|
||||||
char wow;
|
|
||||||
|
|
||||||
FastRAM = AllocMem(RAM_SIZE, MEMF_FAST);
|
|
||||||
|
|
||||||
// this will happen on a machine that has no fast ram at all installed
|
|
||||||
if (FastRAM == 0) {
|
|
||||||
printf("We couldn't allocate Fast RAM. Does this machine have any?\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
((char*)FastRAM)[0]=10;
|
|
||||||
|
|
||||||
printf("Memory location: %d\n", FastRAM);
|
|
||||||
printf("Data at byte 0: %d\n",((char*)FastRAM)[0]);
|
|
||||||
printf("Now, run NoFastMem, then return here and hit Enter\n");
|
|
||||||
|
|
||||||
wow = getc(stdin);
|
|
||||||
|
|
||||||
MoreFastRAM = AllocMem(RAM_SIZE, MEMF_FAST);
|
|
||||||
printf("Attempt to allocate more RAM as Fast RAM: %d\n", MoreFastRAM);
|
|
||||||
if (MoreFastRAM > 0) {
|
|
||||||
printf("We got more RAM, but it's very likely Chip RAM\n");
|
|
||||||
FreeMem(MoreFastRAM, RAM_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Data still at byte 0: %d\n", ((char*)FastRAM)[0]);
|
|
||||||
|
|
||||||
FreeMem(FastRAM, RAM_SIZE);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user