- It should fix some icons scanning file managers, I hope.
#include <stdlib.h>
+/* Config: */
+/* Maximum allocatable (without filling in data) on test: 0xA8000000 */
+#define TOTAL_MAPPED_MAX 0x30000000 /* Maximum mapped area; FIXME: Fix Cache Manager. */
+
+static size_t total_mapped=0;
+
+
+gboolean captive_shared_cache_map_restart_needed(void)
+{
+ return total_mapped>=TOTAL_MAPPED_MAX;
+}
+
+
static GHashTable *CaptiveSharedCacheMapObject_hash;
static void CaptiveSharedCacheMapObject_hash_init(void)
if (base==MAP_FAILED)
goto size_new_big;
g_assert(base!=NULL);
+ total_mapped+=alloc_new;
base+=PAGE_SIZE;
errint=munmap(base-PAGE_SIZE,PAGE_SIZE); /* unmap leading boundary check page */
errint=munmap(captive_shared_cache_map_object->buffer,captive_shared_cache_map_object->alloc_length);
g_assert(errint==0);
+ total_mapped-=captive_shared_cache_map_object->alloc_length;
}
captive_shared_cache_map_object->buffer=buffer_new;
gboolean captive_shared_cache_map_is_any_dirty(void);
gint64 captive_shared_cache_map_CcGetDirtyPages(PDIRTY_PAGE_ROUTINE DirtyPageRoutine,VOID *Context1,VOID *Context2);
gpointer captive_shared_cache_map_get_buffer(CaptiveSharedCacheMapObject *captive_shared_cache_map_object);
+gboolean captive_shared_cache_map_restart_needed(void);
G_END_DECLS
#include "captive/usecount.h"
#include "vfs.h"
#include "vfs-slave.h"
+#include "../cc/sharedcachemap.h"
/* Config: */
-#define MAX_FILE_READ 0x1000000 /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */
+#define MAX_FILE_READ 0x8000000 /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */
#define MAX_FILE_WRITTEN 0x100000 /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */
g_return_val_if_fail(captive_file_slave_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
+ if (captive_shared_cache_map_restart_needed())
+ return GNOME_VFS_ERROR_SERVICE_OBSOLETE;
+
errvfsresult=captive_ObjectAttributes_init(pathname,&file_ObjectAttributes);
g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult);