Use AncestralClass to speed up Object::cast_to when possible.

This commit is contained in:
Lukas Tenbrink 2025-09-22 01:30:57 +02:00
parent 149a4b4ca1
commit 96619d46a1
15 changed files with 62 additions and 8 deletions

View file

@ -42,6 +42,8 @@ protected:
static void _bind_methods();
public:
static constexpr AncestralClass static_ancestral_class = AncestralClass::REF_COUNTED;
_FORCE_INLINE_ bool is_referenced() const { return refcount_init.get() != 1; }
bool init_ref();
bool reference(); // returns false if refcount is at zero and didn't get increased