aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fractal-gen.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fractal-gen.c b/fractal-gen.c
index 30f405b..38e2a08 100644
--- a/fractal-gen.c
+++ b/fractal-gen.c
@@ -80,13 +80,12 @@ int main(int argc, char **argv)
}
/* Allocate memory for sections */
-/* if ((sections = malloc(sizeof(data_section)*cores)) == NULL)*/
- sections = mmap(NULL, sizeof(data_section)*cores, PROT_READ|PROT_WRITE,
- MAP_SHARED|MAP_ANONYMOUS, -1, 0);
-/* {
+ if ((sections = mmap(NULL, sizeof(data_section)*cores, PROT_READ|PROT_WRITE,
+ MAP_SHARED|MAP_ANONYMOUS, -1, 0)) == (data_section*)MAP_FAILED)
+ {
perror("mmap");
return 1;
- }*/
+ }
ram_nice = (size*size)/clust_total;
if (ram_nice < 1024)