[PATCH,RFA] Ensure check_may_shrink_heap always returns the final value
Roland McGrath
roland@hack.frob.com
Tue Jan 13 20:49:00 GMT 2015
The substance of the change is OK. But I don't like the variable
names. Using "global" in the name of something that is not in global
scope looks odd (I realize you intended a different sense of "global",
but still). Also, while you're there you can replace __builtin_expect
with __glibc_likely.
I'm inclined to say the cleanest thing would be to factor out the
nontrivial code into a subroutine, so you can just write:
if (__glibc_unlikely (may_shrink_heap < 0))
may_shrink_heap = __libc_enable_secure || overcommit_disabled ();
return may_shrink_heap;
Thanks,
Roland
More information about the Libc-alpha
mailing list