struct pool *pool;
struct lease **lpchain;
{
+#if defined(COMPACT_LEASES)
struct lease *address_range;
+#endif
unsigned min, max, i;
char lowbuf [16], highbuf [16], netbuf [16];
struct shared_network *share = subnet -> shared_network;
extern struct lease *lease_hunks;
#endif
-void free_everything ()
+void free_everything(void)
{
struct subnet *sc = (struct subnet *)0, *sn = (struct subnet *)0;
struct shared_network *nc = (struct shared_network *)0,
*in = (struct interface_info *)0;
struct class *cc = (struct class *)0, *cn = (struct class *)0;
struct collection *lp;
- void *st = (shared_networks
- ? (shared_networks -> next
- ? shared_networks -> next -> next : 0) : 0);
int i;
-
/* Get rid of all the hash tables. */
if (host_hw_addr_hash)
host_free_hash_table (&host_hw_addr_hash, MDL);
host_free_hash_table (&host_uid_hash, MDL);
host_uid_hash = 0;
if (lease_uid_hash)
- lease_free_hash_table (&lease_uid_hash, MDL);
+ lease_id_free_hash_table (&lease_uid_hash, MDL);
lease_uid_hash = 0;
if (lease_ip_addr_hash)
- lease_free_hash_table (&lease_ip_addr_hash, MDL);
+ lease_ip_free_hash_table (&lease_ip_addr_hash, MDL);
lease_ip_addr_hash = 0;
if (lease_hw_addr_hash)
- lease_free_hash_table (&lease_hw_addr_hash, MDL);
+ lease_id_free_hash_table (&lease_hw_addr_hash, MDL);
lease_hw_addr_hash = 0;
if (host_name_hash)
host_free_hash_table (&host_name_hash, MDL);
}
/* So are shared networks. */
+ /* XXX: this doesn't work presently, but i'm ok just filtering
+ * it out of the noise (you get a bigger spike on the real leaks).
+ * It would be good to fix this, but it is not a "real bug," so not
+ * today. This hack is incomplete, it doesn't trim out sub-values.
+ */
if (shared_networks) {
+ shared_network_dereference (&shared_networks, MDL);
+ /* This is the old method (tries to free memory twice, broken) */
+ } else if (0) {
shared_network_reference (&nn, shared_networks, MDL);
do {
if (nn) {
universe_free_hash_table (&universe_hash, MDL);
for (i = 0; i < universe_count; i++) {
+#if 0
union {
const char *c;
char *s;
} foo;
+#endif
if (universes [i]) {
- if (universes [i] -> hash)
- option_free_hash_table (&universes [i] -> hash,
- MDL);
+ if (universes[i]->name_hash)
+ option_name_free_hash_table(
+ &universes[i]->name_hash,
+ MDL);
+ if (universes[i]->code_hash)
+ option_code_free_hash_table(
+ &universes[i]->code_hash,
+ MDL);
#if 0
if (universes [i] -> name > (char *)&end) {
foo.c = universes [i] -> name;
relinquish_free_binding_values ();
relinquish_free_option_caches ();
relinquish_free_packets ();
+#if defined(COMPACT_LEASES)
relinquish_lease_hunks ();
+#endif
relinquish_hash_bucket_hunks ();
omapi_type_relinquish ();
}