Add ValidatedCall to MethodBind
* This should optimize GDScript function calling _enormously_. * It also should simplify the GDScript VM considerably. NOTE: GDExtension calling performance has most likely been affected until going via ptrcall is fixed.
This commit is contained in:
parent
14c582bca8
commit
1c93606e47
31 changed files with 299 additions and 84 deletions
|
|
@ -295,4 +295,16 @@ struct GetTypeInfo<const Ref<T> &> {
|
|||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct VariantInternalAccessor<Ref<T>> {
|
||||
static _FORCE_INLINE_ Ref<T> get(const Variant *v) { return Ref<T>(*VariantInternal::get_object(v)); }
|
||||
static _FORCE_INLINE_ void set(Variant *v, const Ref<T> &p_ref) { VariantInternal::refcounted_object_assign(v, p_ref.ptr()); }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct VariantInternalAccessor<const Ref<T> &> {
|
||||
static _FORCE_INLINE_ Ref<T> get(const Variant *v) { return Ref<T>(*VariantInternal::get_object(v)); }
|
||||
static _FORCE_INLINE_ void set(Variant *v, const Ref<T> &p_ref) { VariantInternal::refcounted_object_assign(v, p_ref.ptr()); }
|
||||
};
|
||||
|
||||
#endif // REF_COUNTED_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue