diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2017-08-17 18:35:55 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2017-08-17 19:51:13 -0300 |
commit | eab850524ead092ed9fe22e57955e59eae373b79 (patch) | |
tree | 1ec2718c0810d852b51c4d40c135f4dde3841906 /core/vector.h | |
parent | 33c1d25517050470689924c60414feaf295ce05f (diff) | |
download | redot-engine-eab850524ead092ed9fe22e57955e59eae373b79.tar.gz |
Add closest_power_of_2 func and implement mix_rate/latency on OS X
Diffstat (limited to 'core/vector.h')
-rw-r--r-- | core/vector.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/vector.h b/core/vector.h index 9f523c567c..966832ac50 100644 --- a/core/vector.h +++ b/core/vector.h @@ -71,7 +71,7 @@ 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(p_elements * sizeof(T)); + return next_power_of_2(p_elements * sizeof(T)); } _FORCE_INLINE_ bool _get_alloc_size_checked(size_t p_elements, size_t *out) const { @@ -79,7 +79,7 @@ class Vector { size_t o; size_t p; if (_mul_overflow(p_elements, sizeof(T), &o)) return false; - *out = nearest_power_of_2(o); + *out = next_power_of_2(o); if (_add_overflow(o, static_cast<size_t>(32), &p)) return false; //no longer allocated here return true; #else |