captive_shared_cache_map_set_data_valid() validates the subset of the range.
authorshort <>
Fri, 22 Aug 2003 09:31:51 +0000 (09:31 +0000)
committershort <>
Fri, 22 Aug 2003 09:31:51 +0000 (09:31 +0000)
 - It validated the superset before - even the bytes not wished to be valid.

src/libcaptive/cc/sharedcachemap.c

index 4dbd2da..c8ecba4 100644 (file)
@@ -441,8 +441,9 @@ guint64 now;
        g_return_if_fail(start<=end);
        g_return_if_fail(end<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE));
 
-       start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE);
-       end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE);
+       start=CAPTIVE_ROUND_UP64(start,PAGE_SIZE);
+       end=CAPTIVE_ROUND_DOWN64(end,PAGE_SIZE);
+       /* We may get end<start here - it is valid to not to validate anything. */
 
        for (now=start;now<end;now+=PAGE_SIZE) {
                captive_shared_cache_map_object->pages[now/PAGE_SIZE].data_valid=TRUE;