diff options
| author | punto- | 2016-04-11 03:34:10 -0300 |
|---|---|---|
| committer | Rémi Verschelde | 2016-04-11 08:49:44 +0200 |
| commit | e8a0b2462b11528838ad5890f2146a84a9e70f93 (patch) | |
| tree | 50bd648e95af64532f485caecee2cf711b695d2d /core/vector.h | |
| parent | d454e64f429affb89de036eed6daa5c6e5278492 (diff) | |
| download | godot-e8a0b2462b11528838ad5890f2146a84a9e70f93.tar.gz godot-e8a0b2462b11528838ad5890f2146a84a9e70f93.tar.zst godot-e8a0b2462b11528838ad5890f2146a84a9e70f93.zip | |
Diffstat (limited to 'core/vector.h')
| -rw-r--r-- | core/vector.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/vector.h b/core/vector.h index 16a09c1dd..87248ccf6 100644 --- a/core/vector.h +++ b/core/vector.h @@ -70,7 +70,8 @@ class Vector { } _FORCE_INLINE_ size_t _get_alloc_size(size_t p_elements) const { - return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int)); + //return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int)); + return nearest_power_of_2(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int)); } _FORCE_INLINE_ bool _get_alloc_size_checked(size_t p_elements, size_t *out) const { @@ -79,7 +80,7 @@ class Vector { size_t p; if (_mul_overflow(p_elements, sizeof(T), &o)) return false; if (_add_overflow(o, sizeof(SafeRefCount)+sizeof(int), &p)) return false; - *out = nearest_power_of_2_templated(p); + *out = nearest_power_of_2(p); return true; #else // Speed is more important than correctness here, do the operations unchecked |
