Title | AWL alignment is not configurable |
Status | closed |
Priority | essential |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | The walkt0 test case [1] 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 [2], it says, "The alignment of blocks is configurable," and this came from "A guide to MPS pool classes and their properties" [3] (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 [4] which gives some confidence that (B) is correct. |
How found | automated_test |
Evidence | [1] <http://www.ravenbrook.com/project/mps/master/code/walkt0.c >[2] < http://www.ravenbrook.com/project/mps/master/manual/html/pool/awl.html >[3] < https://info.ravenbrook.com/project/mp...minfo/mmdoc/doc/mps/guide/pool-classes/ >[4] < https://info.ravenbrook.com/project/mps/mail/1997/07/30/12-29/0.txt > |
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. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
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. |