[m-rev.] for review: delete some redundant checks for NULL
Zoltan Somogyi
zoltan.somogyi at runbox.com
Sat May 3 18:05:00 AEST 2025
I asked boehm_gc's maintainer which allocating macros and functions
are guaranteed never to return NULL unless the out-of-memory handler
itself returns NULL, and they include all the ones we use. (I created a pull
request to make this explicit in boehm_gc's upstream documentation
of all the relevant macros/functions; that request was accepted.)
So this diff deletes the NULL checks that we now know are redundant.
For review by anyone.
Since the deleted tests were extremely easy for branch predictors to handle,
I don't expect a significant speedup. However, next I intend to look into
optimizing away calls to MR_GC_malloc, MR_GC_malloc_atomic et al
if we using boehm gc; since their bodies now contain nothing but
a call to the associated boehm allocation macro, calls to them can be replaced
by a direct invocation of that macro. This should yield a bigger speedup,
though I don't know what it will do to code size.
BTW, does anyone happen to know why *initializing* conservative gc
handles both MR_BOEHM_GC and MR_HGC, but the alliocation functions
themselves do not handle MR_HGC, and assume, incorrectly, that
MR_CONSERVATIVE_GC can mean only MR_BOEHM_GC?
Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.null
Type: application/octet-stream
Size: 619 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20250503/b67c93ff/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.null
Type: application/octet-stream
Size: 6394 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20250503/b67c93ff/attachment-0001.obj>
More information about the reviews
mailing list