Avoid calculating size of size class twice & delete sc_data_global.
This commit is contained in:
parent
011449f17b
commit
eb196815d6
7
src/sc.c
7
src/sc.c
@ -13,8 +13,6 @@
|
|||||||
* at least the damage is compartmentalized to this file.
|
* at least the damage is compartmentalized to this file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sc_data_t sc_data_global;
|
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
reg_size_compute(int lg_base, int lg_delta, int ndelta) {
|
reg_size_compute(int lg_base, int lg_delta, int ndelta) {
|
||||||
return (ZU(1) << lg_base) + (ZU(ndelta) << lg_delta);
|
return (ZU(1) << lg_base) + (ZU(ndelta) << lg_delta);
|
||||||
@ -64,9 +62,8 @@ size_class(
|
|||||||
sc->lg_base = lg_base;
|
sc->lg_base = lg_base;
|
||||||
sc->lg_delta = lg_delta;
|
sc->lg_delta = lg_delta;
|
||||||
sc->ndelta = ndelta;
|
sc->ndelta = ndelta;
|
||||||
sc->psz = (reg_size_compute(lg_base, lg_delta, ndelta)
|
size_t size = reg_size_compute(lg_base, lg_delta, ndelta);
|
||||||
% (ZU(1) << lg_page) == 0);
|
sc->psz = (size % (ZU(1) << lg_page) == 0);
|
||||||
size_t size = (ZU(1) << lg_base) + (ZU(ndelta) << lg_delta);
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
assert(!sc->psz);
|
assert(!sc->psz);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user