{
static unsigned long dmalloc_cutoff_point;
struct dmalloc_preamble *dp;
+#if defined(DEBUG_MALLOC_POOL)
unsigned char *foo;
- int i;
+#endif
if (!dmalloc_cutoff_point)
dmalloc_cutoff_point = dmalloc_cutoff_generation;
if (rc_history [i].addr == dp + 1) {
inhistory = 1;
if (!noted) {
- log_info (" %s(%d): %d", dp -> file,
+ log_info (" %s(%d): %ld", dp -> file,
dp -> line, dp -> size);
noted = 1;
}
} while (count--);
if (!inhistory)
#endif
- log_info (" %s(%d): %d",
+ log_info (" %s(%d): %ld",
dp -> file, dp -> line, dp -> size);
}
#endif
i += RC_HISTORY_MAX;
}
rc_history_count = 0;
-
+
while (rc_history [i].file) {
if (!addr || addr == rc_history [i].addr)
print_rc_hist_entry (i);
int min, int max)
{
int middle;
- int cmp;
middle = (min + max) / 2;
if (middle == min)
void omapi_print_dmalloc_usage_by_caller ()
{
struct dmalloc_preamble *dp;
- unsigned char *foo;
- int ccur, cmax, i, j;
+ int ccur, cmax, i;
struct caller cp [1024];
cmax = 1024;
for (i = 0; i < ccur; i++) {
printf ("%d\t%s:%d\t%d\n", i,
cp [i].dp -> file, cp [i].dp -> line, cp [i].count);
+#if defined(DUMP_RC_HISTORY)
dump_rc_history (cp [i].dp + 1);
+#endif
}
}
#endif /* DEBUG_MEMORY_LEAKAGE || DEBUG_MALLOC_POOL */
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 ();
}