updated boost on windows

This commit is contained in:
Bassem Girgis
2019-08-13 21:48:48 -05:00
parent 7d77d485fd
commit b40a3bee82
5162 changed files with 473027 additions and 116452 deletions

View File

@@ -293,8 +293,8 @@ public:
/// Move-assigns the data from \p other to \c *this.
vector& operator=(vector&& other)
{
if(m_size){
m_allocator.deallocate(m_data, m_size);
if(capacity() > 0){
m_allocator.deallocate(m_data, capacity());
}
m_data = std::move(other.m_data);
@@ -310,8 +310,8 @@ public:
/// Destroys the vector object.
~vector()
{
if(m_size){
m_allocator.deallocate(m_data, m_size);
if(capacity() > 0){
m_allocator.deallocate(m_data, capacity());
}
}
@@ -401,11 +401,14 @@ public:
)
);
// copy old values to the new buffer
::boost::compute::copy(m_data, m_data + m_size, new_data, queue);
if(capacity() > 0)
{
// copy old values to the new buffer
::boost::compute::copy(m_data, m_data + m_size, new_data, queue);
// free old memory
m_allocator.deallocate(m_data, m_size);
// free old memory
m_allocator.deallocate(m_data, capacity());
}
// set new data and size
m_data = new_data;
@@ -430,13 +433,39 @@ public:
/// Returns the capacity of the vector.
size_type capacity() const
{
if(m_data == pointer()) // null pointer check
{
return 0;
}
return m_data.get_buffer().size() / sizeof(T);
}
void reserve(size_type size, command_queue &queue)
{
(void) size;
(void) queue;
if(size > max_size()){
throw std::length_error("vector::reserve");
}
if(capacity() < size){
// allocate new buffer
pointer new_data =
m_allocator.allocate(
static_cast<size_type>(
static_cast<float>(size) * _growth_factor()
)
);
if(capacity() > 0)
{
// copy old values to the new buffer
::boost::compute::copy(m_data, m_data + m_size, new_data, queue);
// free old memory
m_allocator.deallocate(m_data, capacity());
}
// set new data
m_data = new_data;
}
}
void reserve(size_type size)
@@ -448,7 +477,22 @@ public:
void shrink_to_fit(command_queue &queue)
{
(void) queue;
pointer old_data = m_data;
m_data = pointer(); // null pointer
if(m_size > 0)
{
// allocate new buffer
m_data = m_allocator.allocate(m_size);
// copy old values to the new buffer
::boost::compute::copy(old_data, old_data + m_size, m_data, queue);
}
if(capacity() > 0)
{
// free old memory
m_allocator.deallocate(old_data, capacity());
}
}
void shrink_to_fit()