5 comments:
Patch Set #1, Line 9: This change adds support for
nit: just "Add"?
Patch Set #1, Line 172: Limit beyond which the stolen memory cannot grow
so an upper bound for the memory range to reserve?
If it is not possible to fulfill the request as per given constraints, this function returns
* false. Else, it sets the base address of stolen memory in stolen_base, creates a hole of
* required size at the stolen_base and returns true to indicate success
I think it's better to state the successful case first. It could also be clearer that stolen_base is an output argument, never to be read from (this statement can be interpreted to mean that a value put in there might be used to choose the base address).
How about:
"If the constraints can be satified, this functin creates a hole in the memrange, writes the base address of that hole to stolen_base and returns true. Otherwise it returns false"?
if (size == 0) return NULL; otherwise memranges_steal() with a computed size==0 leads to weird artifacts in stolen_base.
While at it, maybe check that align is a power of two (ALIGN_UP does wonky stuff otherwise)?
Patch Set #1, Line 403: base = ALIGN_UP(r->begin, align);
do you intend to use the new memrange align attribute for comparison, too? if (!IS_ALIGNED(align, r->align)) continue; or something like that?
To view, visit change 39484. To unsubscribe, or for help writing mail filters, visit settings.