diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-02 15:54:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-02 15:54:18 +0200 |
commit | 33258d850cf6b40d9b20ba9643f98b3553c392c4 (patch) | |
tree | cb918e8226e14369c0ab37cf9969ab206ed747b2 /core/variant/variant.h | |
parent | 4f8d31fc68c1b2276cbcbb62a308d59313b9fac6 (diff) | |
parent | b221eab4260c471c37ff2aae2546fcfa6dd7ac58 (diff) |
Merge pull request #61315 from lawnjelly/variant_bucket_pools
Variant memory pools
Diffstat (limited to 'core/variant/variant.h')
-rw-r--r-- | core/variant/variant.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/variant/variant.h b/core/variant/variant.h index bfa110842a..ea75dce4ce 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -54,6 +54,7 @@ #include "core/os/keyboard.h" #include "core/string/node_path.h" #include "core/string/ustring.h" +#include "core/templates/paged_allocator.h" #include "core/templates/rid.h" #include "core/variant/array.h" #include "core/variant/callable.h" @@ -134,6 +135,24 @@ public: }; private: + struct Pools { + union BucketSmall { + BucketSmall() {} + ~BucketSmall() {} + Transform2D _transform2d; + ::AABB _aabb; + }; + union BucketLarge { + BucketLarge() {} + ~BucketLarge() {} + Basis _basis; + Transform3D _transform3d; + }; + + static PagedAllocator<BucketSmall, true> _bucket_small; + static PagedAllocator<BucketLarge, true> _bucket_large; + }; + friend struct _VariantCall; friend class VariantInternal; // Variant takes 20 bytes when real_t is float, and 36 if double |