mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-30 05:00:11 +02:00
Update to v106r30 release.
byuu says: Changelog: - nall/GNUmakefile: fixed findstring parameter arguments [Screwtape] - nall/Windows: always include -mthreads -lpthread for all applications - nall/memory: code restructuring I really wanted to work on the new PPU today, but I thought I'd spend a few minutes making some minor improvements to nall::memory, that was five and a half hours ago. Now I have a 67KiB diff of changes. Sigh.
This commit is contained in:
@@ -4,7 +4,7 @@ namespace nall {
|
||||
|
||||
template<typename T> auto vector<T>::operator=(const vector<T>& source) -> vector<T>& {
|
||||
if(this == &source) return *this;
|
||||
_pool = (T*)memory::allocate(sizeof(T) * source._size);
|
||||
_pool = memory::allocate<T>(source._size);
|
||||
_size = source._size;
|
||||
_left = 0;
|
||||
_right = 0;
|
||||
|
@@ -27,7 +27,7 @@ template<typename T> auto vector<T>::reserveLeft(uint capacity) -> bool {
|
||||
if(_size + _left >= capacity) return false;
|
||||
|
||||
uint left = bit::round(capacity);
|
||||
auto pool = (T*)memory::allocate(sizeof(T) * (left + _right)) + (left - _size);
|
||||
auto pool = memory::allocate<T>(left + _right) + (left - _size);
|
||||
for(uint n : range(_size)) new(pool + n) T(move(_pool[n]));
|
||||
memory::free(_pool - _left);
|
||||
|
||||
@@ -41,7 +41,7 @@ template<typename T> auto vector<T>::reserveRight(uint capacity) -> bool {
|
||||
if(_size + _right >= capacity) return false;
|
||||
|
||||
uint right = bit::round(capacity);
|
||||
auto pool = (T*)memory::allocate(sizeof(T) * (_left + right)) + _left;
|
||||
auto pool = memory::allocate<T>(_left + right) + _left;
|
||||
for(uint n : range(_size)) new(pool + n) T(move(_pool[n]));
|
||||
memory::free(_pool - _left);
|
||||
|
||||
|
Reference in New Issue
Block a user