= Aligned free-block capacity
<Aligned free-block capacity> is the usable payload that a particular free extent can supply after meeting <memory alignment> and metadata requirements. It differs from the raw extent length and from the <largest free memory block>. For an illustrative block $[a,b)$, header requirement $h$ and payload alignment $A>0$, the first permissible payload start is
$$
p=A\left\lceil\frac{a+h}{A}\right\rceil.
$$
If the allocator reserves no trailer or additional rounding, usable payload capacity is $\max(b-p,0)$. This formula belongs to the stated layout; it is not a universal allocator ABI.
For a free interval $[3,67)$ in <byte> offsets, an8-<byte> header and16-<byte> alignment give $p=16$. The raw64-<byte> extent then has51 <bytes> after the aligned start. <Allocation alignment padding> is $p-(a+h)=5$ <bytes>, in addition to the8-<byte> header. A48-<byte> payload fits this model, whereas a52-<byte> payload does not.
If allocated payload size must also be rounded to a multiple $q$, a requested size $R$ needs $q\lceil R/q\rceil$ usable <bytes>. For $q=8$ in the same example, the largest such payload is48 <bytes>: a49-<byte> request rounds to56 and fails. Header information and allocation granularity can therefore change the answer even when the alignment condition itself is satisfied.<Operating Systems: Three Easy Pieces by Remzi H. Arpaci-Dusseau and others>[Chapter17, §17.2, allocation headers and total-region bookkeeping, printed pp.5–6]{ref}
For integer addresses, the padding before the payload lies between0 and $A-1$ <bytes>. Splitting a chosen block can introduce another constraint: a leftover interval may be too small to hold a free record. A capacity calculation must consequently identify the actual header, alignment, rounding and remainder conventions rather than treating every raw free byte as payload.
Back to article page