fs_backing_store: Clear entry memory flags on read

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-02-23 23:04:49 +00:00
parent f3a0e9f0a1
commit 360997c265
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
1 changed files with 5 additions and 0 deletions

View File

@ -1194,8 +1194,13 @@ read_entries(struct store_state *state)
nsurl_unref(nsurl);
NSLOG(netsurf, DEBUG, "Successfully read entry for %s", nsurl_access(ent->url));
read_entries++;
/* Note the size allocation */
state->total_alloc += ent->elem[ENTRY_ELEM_DATA].size;
state->total_alloc += ent->elem[ENTRY_ELEM_META].size;
/* And ensure we don't pretend to have this in memory yet */
ent->elem[ENTRY_ELEM_DATA].flags &= ~(ENTRY_ELEM_FLAG_HEAP | ENTRY_ELEM_FLAG_MMAP);
ent->elem[ENTRY_ELEM_META].flags &= ~(ENTRY_ELEM_FLAG_HEAP | ENTRY_ELEM_FLAG_MMAP);
}
close(fd);
}