[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1562-g6708b92

Michael Adam obnox at samba.org
Tue May 12 06:41:54 GMT 2009


The branch, master has been updated
       via  6708b926a47b53a2984de6af9bb9d319ed6efe58 (commit)
       via  6aef9bbbf7160cf9e79c50e13632bf29efaedb65 (commit)
      from  a04bac71356139c62d786f6254d33bd247fb7692 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6708b926a47b53a2984de6af9bb9d319ed6efe58
Author: Michael Adam <obnox at samba.org>
Date:   Wed May 6 02:25:08 2009 +0200

    s3:loadparm: free the file_list at the start of loadparm
    
    This should reduce the waste of memory when using "config file"
    or "config backend". It also reduces the risk of triggering
    reloads due to some old unused files being checked.
    
    Michael

commit 6aef9bbbf7160cf9e79c50e13632bf29efaedb65
Author: Michael Adam <obnox at samba.org>
Date:   Wed May 6 02:09:56 2009 +0200

    s3:loadparm: refactor freeing of file_list out into free_file_lists()
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source3/param/loadparm.c |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a6c535c..da0bf17 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -6977,6 +6977,26 @@ static void add_to_file_list(const char *fname, const char *subfname)
 }
 
 /**
+ * Free the file lists
+ */
+static void free_file_list(void)
+{
+	struct file_lists *f;
+	struct file_lists *next;
+
+	f = file_lists;
+	while( f ) {
+		next = f->next;
+		SAFE_FREE( f->name );
+		SAFE_FREE( f->subfname );
+		SAFE_FREE( f );
+		f = next;
+	}
+	file_lists = NULL;
+}
+
+
+/**
  * Utility function for outsiders to check if we're running on registry.
  */
 bool lp_config_backend_is_registry(void)
@@ -8962,21 +8982,9 @@ int load_usershare_shares(void)
 
 void gfree_loadparm(void)
 {
-	struct file_lists *f;
-	struct file_lists *next;
 	int i;
 
-	/* Free the file lists */
-
-	f = file_lists;
-	while( f ) {
-		next = f->next;
-		SAFE_FREE( f->name );
-		SAFE_FREE( f->subfname );
-		SAFE_FREE( f );
-		f = next;
-	}
-	file_lists = NULL;
+	free_file_list();
 
 	/* Free resources allocated to services */
 
@@ -9040,6 +9048,8 @@ bool lp_load_ex(const char *pszFname,
 	init_globals(! initialize_globals);
 	debug_init();
 
+	free_file_list();
+
 	if (save_defaults) {
 		init_locals();
 		lp_save_defaults();


-- 
Samba Shared Repository


More information about the samba-cvs mailing list