From ac51181f34e91572ba54853de98095f2c6aefd5a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 18 Jan 2021 13:06:25 -0800 Subject: Removed dead code for interning files (no longer needed since temp file change) --- files.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'files.c') diff --git a/files.c b/files.c index 6d43c03..414057c 100644 --- a/files.c +++ b/files.c @@ -121,25 +121,6 @@ file_t *spoof_file(file_t **files, const char *filename, const char *text) return f; } -// -// Ensure that the file's contents are held in memory, rather than being memory -// mapped IO. -// -void intern_file(file_t *f) -{ - if (!f->mmapped) return; - size_t size = (size_t)(f->end - f->contents); - char *buf = xcalloc(sizeof(char), size + 1); - memcpy(buf, f->contents, size); - check(munmap(f->contents, size) == 0, - "Failure to un-memory-map some memory"); - f->contents = buf; - f->end = buf + size; - f->mmapped = false; - xfree(&f->lines); - populate_lines(f); -} - // // Free a file and all memory contained inside its members, then set the input // pointer to NULL. -- cgit v1.2.3