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:
Tim Allen
2018-05-28 11:16:27 +10:00
parent 6882bd98cf
commit 685cec6583
73 changed files with 372 additions and 389 deletions

View File

@@ -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;

View File

@@ -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);