Poisoning in HotSpot
Kim Barrett
kim.barrett at oracle.com
Sun Dec 1 15:16:10 UTC 2024
On 12/1/24 7:35 AM, Kim Barrett wrote:
>
> How about this: [code snipped]
>
I decided I like this enough to work on implementing it. A couple of
points.
There are several uses of ALLOW_C_FUNCTION for functions that aren't
forbidden. The new mechanism prevents that from happening. Trying to
reference
permit_forbidden_function::<name> without an in-scope
FORBID_C_FUNCTION(<name>) will fail. That seems like a good thing.
I'm adding two macros, FORBID_C_FUNCTION and FORBID_C_FUNCTION_ALWAYS. The
latter doesn't provide a permit alias. You're just never supposed to
use it.
We have several like that, and the old mechanism didn't support such a
distinction.
There are uses of FORBID_C_FUNCTION in shared code for functions that might
not be declared. For example, get_current_dir_name is documented as a GNU
extension. I'm guessing it's not available on Windows. That won't work with
the new mechanism. That seems like probably a good thing too. Though it
might force forbidding in some non-obvious place. Worse, it could force
inclusion of some file for the sake of a declaration that you are then going
to forbid. Though you could forward declare such a function.
More information about the hotspot-dev
mailing list