Module Name: krb5 Committed By: raeburn Date: Fri Dec 20 22:38:05 UTC 2002 Modified Files: krb5/src/util/profile/ChangeLog krb5/src/util/profile/prof_file.c krb5/src/util/profile/prof_int.h krb5/src/util/profile/prof_set.c Added Files: Removed Files: Log Message Merge in data tree sharing, minus locking support, plus a bugfix or two. * prof_int.h (SHARE_TREE_DATA): Define. (struct _prf_file_t) [SHARE_TREE_DATA]: Make data field a pointer rather than an array. (struct global_shared_profile_data): New type, for profile library global data. (krb5int_profile_shared_data): Declare new variable. (g_shared_trees): New macro, refers to a field in the global data. (PROFILE_FILE_SHARED): New flag macro. * prof_file.c (krb5int_profile_shared_data): Initialize here. (profile_open_file) [SHARE_TREE_DATA]: Scan g_shared_trees for an entry with the same filename. If found, increment its reference count, update it, and return it; otherwise, allocate a new one, and add it to the list after filling it in. (profile_dereference_data): New function. Decrement reference count if SHARE_TREE_DATA, and free the data if appropriate. (profile_free_file): Call profile_dereference_data. (profile_free_file_data) [SHARE_TREE_DATA]: If the SHARED flag is set, remove it from the g_shared_trees list before freeing. Free up the allocated space. * prof_set.c (rw_setup) [SHARE_TREE_DATA]: If the object's data is shared, copy it into a new data structure not in the global shared list, and dereference the old one. To generate a diff of this commit: cvs diff -r1.119 -r1.120 krb5/src/util/profile/ChangeLog cvs diff -r1.23 -r1.24 krb5/src/util/profile/prof_file.c cvs diff -r1.24 -r1.25 krb5/src/util/profile/prof_int.h cvs diff -r1.3 -r1.4 krb5/src/util/profile/prof_set.c