From b730fbc6b86d777e80856e997ddc56fc4a851769 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 17 May 2013 01:20:39 -0400 Subject: Remove the dlopen() pointer from struct filedef. This pointer is almost never needed, and it increases the size of the filedef struct for all files (of which there are a huge number for large builds). Instead keep a bit field marking whether the file is a loaded object and if so call a new function to unload it. In load.c we keep a simple linked list of loaded objects (of which there will be very few typically) and their dlopen() pointers. --- read.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'read.c') diff --git a/read.c b/read.c index 50f8414..9dce583 100644 --- a/read.c +++ b/read.c @@ -937,12 +937,11 @@ eval (struct ebuffer *ebuf, int set_default) struct nameseq *next = files->next; const char *name = files->name; struct dep *deps; - void *dlp; free_ns (files); files = next; - if (! load_file (&ebuf->floc, &name, noerror, &dlp) && ! noerror) + if (! load_file (&ebuf->floc, &name, noerror) && ! noerror) fatal (&ebuf->floc, _("%s: failed to load"), name); deps = alloc_dep (); @@ -951,7 +950,7 @@ eval (struct ebuffer *ebuf, int set_default) deps->file = lookup_file (name); if (deps->file == 0) deps->file = enter_file (name); - deps->file->dlopen_ptr = dlp; + deps->file->loaded = 1; } continue; -- cgit v1.2.3