~ubuntu-branches/ubuntu/precise/judy/precise

« back to all changes in this revision

Viewing changes to src/JudyCommon/JudyMallocIF.c

  • Committer: Bazaar Package Importer
  • Author(s): Troy Heber
  • Date: 2007-05-21 15:07:50 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070521150750-khuc7e3iblyvi0a9
Tags: 1.0.5-1
* Fixed alignment issue, (Closes: #401124)
* Update packaging, policy, debhelper, etc.
* Removed old BIT cruft from rules
* Upstream has propper distclean target (Closes: #424425)

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
 
183
183
FUNCTION Pjpm_t j__udyAllocJPM(void)
184
184
{
185
 
        Word_t Words = sizeof(jpm_t) / cJU_BYTESPERWORD;
 
185
        Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD;
186
186
        Pjpm_t Pjpm  = (Pjpm_t) MALLOC(JudyMalloc, Words, Words);
187
187
 
188
188
        assert((Words * cJU_BYTESPERWORD) == sizeof(jpm_t));
524
524
 
525
525
FUNCTION void j__udyFreeJPM(Pjpm_t PjpmFree, Pjpm_t PjpmStats)
526
526
{
527
 
        Word_t Words = sizeof(jpm_t) / cJU_BYTESPERWORD;
 
527
        Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD;
528
528
 
529
529
        // MALLOCBITS_TEST(Pjpm_t, PjpmFree);   // see above.
530
530
        JudyFree((Pvoid_t) PjpmFree, Words);