optimize cgoIsUnsafePtr