rose_build: reduce size/scope of context objects

This commit is contained in:
Alex Coyte
2017-03-30 14:34:33 +11:00
committed by Matthew Barr
parent a2b2940f85
commit 37cb93e60f
14 changed files with 520 additions and 458 deletions

View File

@@ -155,9 +155,9 @@ void bfs(vector<mmbit_sparse_iter> &out, const TreeNode &tree) {
/** \brief Construct a sparse iterator over the values in \a bits for a
* multibit of size \a total_bits. */
void mmbBuildSparseIterator(vector<mmbit_sparse_iter> &out,
const vector<u32> &bits, u32 total_bits) {
assert(out.empty());
vector<mmbit_sparse_iter> mmbBuildSparseIterator(const vector<u32> &bits,
u32 total_bits) {
vector<mmbit_sparse_iter> out;
assert(!bits.empty());
assert(total_bits > 0);
assert(total_bits <= MMB_MAX_BITS);
@@ -186,6 +186,7 @@ void mmbBuildSparseIterator(vector<mmbit_sparse_iter> &out,
#endif
DEBUG_PRINTF("iter has %zu records\n", out.size());
return out;
}
template<typename T>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2016, Intel Corporation
* Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -61,8 +61,8 @@ u32 mmbit_size(u32 total_bits);
/** \brief Construct a sparse iterator over the values in \a bits for a
* multibit of size \a total_bits. */
void mmbBuildSparseIterator(std::vector<mmbit_sparse_iter> &out,
const std::vector<u32> &bits, u32 total_bits);
std::vector<mmbit_sparse_iter>
mmbBuildSparseIterator(const std::vector<u32> &bits, u32 total_bits);
struct scatter_plan_raw;