Skip to content
/ server Public
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion storage/innobase/fsp/fsp0space.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ dberr_t Tablespace::add_datafile(const char *filepath)

/* Now add a new Datafile and set the filepath
using the m_path created above. */
m_files.push_back(Datafile(m_flags, FIL_IBD_FILE_INITIAL_SIZE, 0));
m_files.emplace_back(m_flags, FIL_IBD_FILE_INITIAL_SIZE, 0);
m_files.back().make_filepath(m_path, {basename, strlen(basename) - 4},
IBD);

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/fsp/fsp0sysspace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ SysTablespace::parse_params(
}
}

m_files.push_back(Datafile(flags(), uint32_t(size), order));
m_files.emplace_back(flags(), uint32_t(size), order);
m_files.back().make_filepath(path(),
{filepath, strlen(filepath)},
NO_EXT);
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/trx/trx0purge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ void purge_sys_t::batch_cleanup(const purge_sys_t::iterator &head)
m_active= false;

/* Release the undo pages. */
for (auto p : pages)
for (auto &p : pages)
p.second->unfix();
pages.clear();
pages.reserve(srv_purge_batch_size);
Expand Down
19 changes: 8 additions & 11 deletions tpool/tpool_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,16 @@ template <typename T> class circular_queue
if (new_size <= current_size)
return;
size_t new_capacity = new_size - 1;
std::vector<T> new_buffer(new_capacity);
/* Figure out faster way to copy*/
size_t i = 0;
while (!empty())
size_t const old_size = m_buffer.size();
m_buffer.resize(new_capacity);
if (m_head < m_tail)
{
T& ele = front();
pop();
new_buffer[i++] = ele;
}
m_buffer = new_buffer;
for (size_t i = new_capacity - 1, j = old_size - 1; m_tail <= j; --i, --j)
std::swap(m_buffer[i], m_buffer[j]);
m_tail = m_tail + (m_buffer.size() - old_size);
}
m_capacity = new_capacity;
m_tail = 0;
m_head = current_size;
assert(size() == current_size);
}
void push(T ele)
{
Expand Down