aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files.c19
-rw-r--r--files.h2
2 files changed, 0 insertions, 21 deletions
diff --git a/files.c b/files.c
index 6d43c03..414057c 100644
--- a/files.c
+++ b/files.c
@@ -122,25 +122,6 @@ file_t *spoof_file(file_t **files, const char *filename, const char *text)
}
//
-// 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.
//
diff --git a/files.h b/files.h
index f849a19..63b1c0f 100644
--- a/files.h
+++ b/files.h
@@ -25,8 +25,6 @@ file_t *load_filef(file_t **files, const char *fmt, ...);
__attribute__((nonnull(3), returns_nonnull))
file_t *spoof_file(file_t **files, const char *filename, const char *text);
__attribute__((nonnull))
-void intern_file(file_t *f);
-__attribute__((nonnull))
void destroy_file(file_t **f);
__attribute__((pure, nonnull))
size_t get_line_number(file_t *f, const char *p);