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. --- filedef.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'filedef.h') diff --git a/filedef.h b/filedef.h index 5fa6429..001b904 100644 --- a/filedef.h +++ b/filedef.h @@ -61,8 +61,6 @@ struct file int command_flags; /* Flags OR'd in for cmds; see commands.h. */ char update_status; /* Status of the last attempt to update, or -1 if none has been made. */ - void *dlopen_ptr; /* For dynamic loaded objects: pointer to - pass to dlclose to unload the object. */ enum cmd_state /* State of the commands. */ { /* Note: It is important that cs_not_started be zero. */ cs_not_started, /* Not yet started. */ @@ -71,7 +69,9 @@ struct file cs_finished /* Commands finished. */ } command_state ENUM_BITFIELD (2); + unsigned int builtin:1; /* True if the file is a builtin rule. */ unsigned int precious:1; /* Non-0 means don't delete file on quit */ + unsigned int loaded:1; /* True if the file is a loaded object. */ unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp has only one-second resolution. */ unsigned int tried_implicit:1; /* Nonzero if have searched @@ -95,7 +95,6 @@ struct file considered on current scan of goal chain */ unsigned int no_diag:1; /* True if the file failed to update and no diagnostics has been issued (dontcare). */ - unsigned int builtin:1; /* True if the file is a builtin rule. */ }; -- cgit v1.2.3