If I'm not mistaken there is something wrong with this ksplit condition line
and according to this linec->length >= length so the result of length - c->length always gonna be negative or equal to zero, so the condition must not be passed but it will due to the KUNIT which is #define KUNIT sizeof(struct kmalloc_chunk)
the sizeof function returns a unsigned integer and due to that the negative value that comes from length - c->length will be converted to a unsigned integer and gonna always pass the condition except when the length == c->length.
so is the ksplit condition line a mistake or something else ?
If I'm not mistaken there is something wrong with this ksplit condition line and according to this line
c->length >= length
so the result oflength - c->length
always gonna be negative or equal to zero, so the condition must not be passed but it will due to the KUNIT which is#define KUNIT sizeof(struct kmalloc_chunk)
the sizeof function returns a unsigned integer and due to that the negative value that comes fromlength - c->length
will be converted to a unsigned integer and gonna always pass the condition except when thelength == c->length
. so is the ksplit condition line a mistake or something else ?