From ddfa1fbccfe4c1ec69f7396a4f5842abe70927ba Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 19 Sep 2024 19:02:14 -0300 Subject: GC back to controling pace counting bytes Memory is the resource we want to save. Still to be reviewed again. --- lobject.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lobject.c') diff --git a/lobject.c b/lobject.c index f7159547..1ca03e76 100644 --- a/lobject.c +++ b/lobject.c @@ -85,7 +85,7 @@ lu_byte luaO_codeparam (unsigned int p) { ** more significant bits, as long as the multiplication does not ** overflow, so we check which order is best. */ -l_obj luaO_applyparam (lu_byte p, l_obj x) { +l_mem luaO_applyparam (lu_byte p, l_mem x) { unsigned int m = p & 0xF; /* mantissa */ int e = (p >> 4); /* exponent */ if (e > 0) { /* normalized? */ @@ -94,19 +94,19 @@ l_obj luaO_applyparam (lu_byte p, l_obj x) { } e -= 7; /* correct excess-7 */ if (e >= 0) { - if (x < (MAX_LOBJ / 0x1F) >> e) /* no overflow? */ + if (x < (MAX_LMEM / 0x1F) >> e) /* no overflow? */ return (x * m) << e; /* order doesn't matter here */ else /* real overflow */ - return MAX_LOBJ; + return MAX_LMEM; } else { /* negative exponent */ e = -e; - if (x < MAX_LOBJ / 0x1F) /* multiplication cannot overflow? */ + if (x < MAX_LMEM / 0x1F) /* multiplication cannot overflow? */ return (x * m) >> e; /* multiplying first gives more precision */ - else if ((x >> e) < MAX_LOBJ / 0x1F) /* cannot overflow after shift? */ + else if ((x >> e) < MAX_LMEM / 0x1F) /* cannot overflow after shift? */ return (x >> e) * m; else /* real overflow */ - return MAX_LOBJ; + return MAX_LMEM; } } -- cgit v1.2.3-55-g6feb