|Title||AWL alignment is not configurable|
|Assigned user||Gareth Rees|
|Description||The walkt0 test case  fails on W3I3MV with the assertion:|
mpsi.c:1003: MPS ASSERTION FAILED: SizeIsAligned(size, BufferPool(buf)->alignment)
|Analysis||On W3I3MV, the alignment of the AWL pool is MPS_PF_ALIGN=8, but the alignment of the Dylan object format is sizeof(void*)=4.|
In the Pool Reference for AWL , it says, "The alignment of blocks is configurable," and this came from "A guide to MPS pool classes and their properties"  (see table in §7). But this is not true! If you look at AWLInit() in poolawl.c, you’ll see that it never sets pool->alignment to format->alignment as other classes with formats do; this leaves pool->alignment at the default value, which is MPS_PF_ALIGN.
There are two possibilities:
A. The manual is right and the code in poolawl.c is wrong. AWL should set the pool alignment from the format alignment.
B. There is an undocumented constraint on the alignment of objects in AWL pools that justifies the implementation, and the manual is wrong.
If (B) is the case, then any user of AWL must align allocation sizes up to a multiple of MPS_PF_ALIGN so as to avoid the assertion failure from mpsi.c, which is how awlut.c, awluthe.c and awlutth.c avoid this problem. But DL and I looked at the poolawl.c code and could not see what the undocumented constraint might be.
Note that this problem was reported previously by RB in 1997  which gives some confidence that (B) is correct.
|Created by||Gareth Rees|
|Created on||2014-04-07 18:43:59|
|Last modified by||Gareth Rees|
|Last modified on||2014-09-27 23:33:59|
|History||2014-04-07 GDR Created.|
|185357||closed||2014-04-08 18:29:25||Gareth Rees||The alignment of an AWL pool is now set to the format alignment, as documented. The alignment restriction on pointers is now based on sizeof(void *), not MPS_PF_ALIGN.|