Skip to content

Commit 80f371d

Browse files
Guard MADV_HUGEPAGE with ifdef for macOS compatibility
1 parent dff5b4c commit 80f371d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/clustering/coarsening/clustering/size_constraint_label_propagation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ void size_constraint_label_propagation::label_propagation(const PartitionConfig
119119
m_permutation.resize(N);
120120
cluster_id.resize(N);
121121

122-
// Hint THP for large random-access arrays to reduce TLB misses
122+
// Hint THP for large random-access arrays to reduce TLB misses (Linux only)
123+
#ifdef MADV_HUGEPAGE
123124
if(N > 100000) {
124125
madvise(m_hash_map.data(), N * sizeof(EdgeWeight), MADV_HUGEPAGE);
125126
madvise(cluster_id.data(), N * sizeof(NodeID), MADV_HUGEPAGE);
126127
}
128+
#endif
127129

128130
std::queue< NodeID > Q_a, Q_b;
129131
std::queue< NodeID > * Q = &Q_a;

0 commit comments

Comments
 (0)