~ubuntu-branches/ubuntu/maverick/bind9/maverick

« back to all changes in this revision

Viewing changes to lib/bind/isc/memcluster.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, LaMont Jones, Internet Software Consortium, Inc, localization folks
  • Date: 2008-08-02 14:20:20 UTC
  • mfrom: (1.2.1 upstream) (6.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080802142020-l1hon9jy8lbbjxmg
[LaMont Jones]

* default to using resolvconf if it is installed
* fix sonames and dependencies.  Closes: #149259, #492418
* Do not build-depend libcap2-dev on non-linux.  Closes: #493392
* drop unused query-loc manpage.  Closes: #492564
* lwresd: Deliver /etc/bind directory.  Closes: #490027
* fix query-source comment in default install

[Internet Software Consortium, Inc]

* 9.5.0-P2.  Closes: #492949

[localization folks]

* l10n: Spanish debconf translation.  Closes: #492425 (Ignacio Mondino)
* l10n: Swedish debconf templates.  Closes: #491369 (Martin Ågren)
* l10n: Japanese debconf translations.  Closes: #492048 (Hideki Yamane
  (Debian-JP))
* l10n: Finnish translation.  Closes: #490630 (Esko Arajärvi)
* l10n: Italian debconf translations.  Closes: #492587 (Alessandro Vietta)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
 
26
26
#if !defined(LINT) && !defined(CODECENTER)
27
 
static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.7 2005/10/11 00:48:15 marka Exp $";
 
27
static const char rcsid[] = "$Id: memcluster.c,v 1.11 2006/08/30 23:34:38 marka Exp $";
28
28
#endif /* not lint */
29
29
 
30
30
#include "port_before.h"
355
355
#endif
356
356
}
357
357
 
358
 
/* 
 
358
/*%
359
359
 * This is a call from an external caller, 
360
360
 * so we want to count this as a user "put". 
361
361
 */
399
399
        p = (char *)e + sizeof *e + size;
400
400
        memcpy(&fp, p, sizeof fp);
401
401
        INSIST(fp == BACK_FENCEPOST);
402
 
        INSIST(((int)mem % 4) == 0);
 
402
        INSIST(((u_long)mem % 4) == 0);
403
403
#ifdef MEMCLUSTER_RECORD
404
404
        prev = NULL;
405
405
        if (size == max_size || new_size >= max_size)
410
410
                prev = el;
411
411
                el = el->next;
412
412
        }
413
 
        INSIST(el != NULL);     /* double free */
 
413
        INSIST(el != NULL);     /*%< double free */
414
414
        if (prev == NULL) {
415
415
                if (size == max_size || new_size >= max_size)
416
416
                        activelists[max_size] = el->next;
437
437
 
438
438
        /* The free list uses the "rounded-up" size "new_size": */
439
439
#if defined(DEBUGGING_MEMCLUSTER)
440
 
        memset(mem, 0xa5, new_size - sizeof *e); /* catch write after free */
441
 
        e->size = 0;    /* catch double memput() */
 
440
        memset(mem, 0xa5, new_size - sizeof *e); /*%< catch write after free */
 
441
        e->size = 0;    /*%< catch double memput() */
442
442
#ifdef MEMCLUSTER_RECORD
443
443
        e->file = file;
444
444
        e->line = line;
489
489
        __memput_record(ptr, size, file, line);
490
490
}
491
491
 
492
 
/*
 
492
/*%
493
493
 * Print the stats[] on the stream "out" with suitable formatting.
494
494
 */
495
495
void
523
523
        for (i = 1; i <= max_size; i++) {
524
524
                if ((e = activelists[i]) != NULL)
525
525
                        while (e != NULL) {
526
 
                                fprintf(out, "%s:%d %p:%d\n",
 
526
                                fprintf(out, "%s:%d %p:%lu\n",
527
527
                                        e->file != NULL ? e->file :
528
528
                                                "<UNKNOWN>", e->line,
529
 
                                        (char *)e + sizeof *e, e->size);
 
529
                                        (char *)e + sizeof *e,
 
530
                                        (u_long)e->size);
530
531
                                e = e->next;
531
532
                        }
532
533
        }
548
549
 
549
550
/* Private. */
550
551
 
551
 
/* 
 
552
/*%
552
553
 * Round up size to a multiple of sizeof(void *).  This guarantees that a
553
554
 * block is at least sizeof void *, and that we won't violate alignment
554
555
 * restrictions, both of which are needed to make lists of blocks.
583
584
                INSIST(a[i] == value);
584
585
}
585
586
#endif
 
587
 
 
588
/*! \file */