PLSysSec / rlbox

RLBox sandboxing framework
https://rlbox.dev
MIT License
285 stars 21 forks source link

Add support for is_registered() #35

Closed deian closed 2 years ago

shravanrn commented 2 years ago

@deian Hmm... I wonder if is_registered is misleading. I would have thought this would mean that we are actually checking the callback tables to see if this is a valid callback index (it is in bounds)

I wonder if we want to rename this to is_not_null (or better is_null) to clarify all that we are doing is a null check and we aren't checking if the index itself is valid.

Fwiw, another option that is on the table is to support comparisons with nullptr alone which would allow cb == nullptr. Not sure if this makes sense or not though

deian commented 2 years ago

Calling it is_unregistered; problem with is_null is that it's not obvious that unregister() sets something to null.