Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1037 closed defect (fixed)

Memory pool alignment error when alignment is set to be greater than the default (thanks John Ridges for the report)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-1.6
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:


When alignment is set to be greater than default alignment, the memory allocated from the pool may not be aligned to the required alignment, because the pool's start memory block is not aligned to the required alignment.

Note that ticket #980 had attempted to fix this but it missed few other locations where the bug occurs.

Change History (2)

comment:1 Changed 14 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r3081:

  • fixed the pool allocation routines in PJLIB,
  • add alignment test in pjlib-test (only useful if PJ_POOL_ALIGNMENT is configured in config_site.h),
  • fixed other pool tests in pjlib-test which are broken when PJ_POOL_ALIGNMENT is enlarged

comment:2 Changed 14 years ago by bennylp

In r3082:

  • bug in aligning pointer if sizeof(long) is less than sizeof(void*). Thanks John Ridges for pointing this out
Note: See TracTickets for help on using tickets.