diff --git a/kaminpar-common/datastructures/maxsize_vector.h b/kaminpar-common/datastructures/maxsize_vector.h index da881862..6d729ce5 100644 --- a/kaminpar-common/datastructures/maxsize_vector.h +++ b/kaminpar-common/datastructures/maxsize_vector.h @@ -38,7 +38,7 @@ template class MaxCapacityAllocator : public std::allocator { } void deallocate(T *p, size_type n) { - return Base::deallocate(p, n); + return Base::deallocate(p, std::min(n, _max_capacity)); } private: diff --git a/kaminpar-shm/datastructures/compressed_graph_builder.h b/kaminpar-shm/datastructures/compressed_graph_builder.h index faf572e3..02e3eff6 100644 --- a/kaminpar-shm/datastructures/compressed_graph_builder.h +++ b/kaminpar-shm/datastructures/compressed_graph_builder.h @@ -76,7 +76,8 @@ class CompressedEdgesBuilder { void init(const EdgeID first_edge); /*! - * Adds the (possibly weighted) neighborhood of a node. Note that the neighbourhood vector is modified. + * Adds the (possibly weighted) neighborhood of a node. Note that the neighbourhood vector is + * modified. * * @param node The node whose neighborhood to add. * @param neighbourhood The neighbourhood of the node to add. @@ -796,6 +797,7 @@ CompressedGraph compute_compressed_graph( // If the last chunk is smaller than the chunk size limit, add it explicitly. if (cur_chunk_start != num_nodes) { chunks.emplace_back(cur_chunk_start, num_nodes, cur_first_edge); + max_chunk_size = std::max(max_chunk_size, num_nodes - cur_chunk_start); } };