Report user-readable error for not yet supported large non-mappable areas.
authorshort <>
Sat, 13 Sep 2003 06:59:46 +0000 (06:59 +0000)
committershort <>
Sat, 13 Sep 2003 06:59:46 +0000 (06:59 +0000)
src/libcaptive/cc/sharedcachemap.c

index f1b925e..298d47d 100644 (file)
@@ -175,7 +175,11 @@ guint64 size64_old,size64_new;
        g_assert(size_old==size64_old);
        size64_new=CAPTIVE_ROUND_UP64(AllocationSize,PAGE_SIZE);        
        size_new=size64_new;
-       g_assert(size_new==size64_new);
+       if (size_new!=size64_new) {
+size_new_big:
+               g_error("Mapped size %" G_GUINT64_FORMAT " is too big; FIXME: non-mmap(2)-able areas not yet supported",size64_new);
+               g_assert_not_reached();
+               }
 
        if (size_old!=size_new) {
 gpointer buffer_new;
@@ -195,6 +199,8 @@ int errint;
                                        MAP_PRIVATE|MAP_ANONYMOUS,      /* flags */
                                        -1,     /* fd; ignored due to MAP_ANONYMOUS */
                                        0);     /* offset; ignored due to MAP_ANONYMOUS */
+                       if (base==MAP_FAILED)
+                               goto size_new_big;
                        g_assert(base!=NULL);
 
                        base+=PAGE_SIZE;