|Title||Alignment requirements for manual classes are needlessly strict|
|Assigned user||Gareth Rees|
|Description||All the manually managed memory classes have needlessly strict, and/or wrongly documented, alignment requirements.|
1. MVT. The Pool Class Properties table  says, "MVT pools have configurable alignment, but it may not be smaller than the natural alignment for the platform (see MPS_PF_ALIGN)" but the Pool Reference entry  says, "The minimum alignment supported by pools of this class is sizeof(void *)." This is inconsistent. It is the Properties table that is correct -- in poolmv2.c there's an AVER(SizeIsAligned(align, MPS_PF_ALIGN)) -- but is this necessary?
2. MVFF. The Pool Class Properties table  says, "The alignment of blocks is configurable, but may not be smaller than the natural alignment of the platform." -- but is this necessary?
3. MFS. The Pool Class Properties table  has a footnote which doesn't mention MFS at all.
4. MV. The Pool Class Properties table  says, "The alignment of blocks allocated from MV (Manual Variable) pools is platform-dependent." but doesn't say what it is.
|Analysis||1. I believe that the reason for the alignment requirement is that MVT uses Freelist when memory is low, and so alignment has to be a multiple of freelistMinimumAlignment. But that's sizeof(void*), which is smaller than MPS_PF_ALIGN on some platforms. So we could relax the alignment requirement for MVT down to sizeof(void*).|
2. The situation is similar for MVFF except that MVFF uses the alloc/free protocol, and so there is no need for any constraint on the alignment -- MVFFAlloc and MVFFFree already call SizeAlignUp.
3, 4. The Pool Class Properties table should name MFS and the natural alignment in the footnote.
|Created by||Gareth Rees|
|Created on||2014-04-08 18:04:51|
|Last modified by||Gareth Rees|
|Last modified on||2014-10-20 17:36:49|
|History||2014-04-08 GDR Created.|
|186481||closed||2014-06-11 12:18:40||Gareth Rees||Merge mps/branch/2014-04-08/align into the master sources.|