Skip to content
Closed
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
19 changes: 0 additions & 19 deletions src/rt/rust_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@ extern struct type_desc str_body_tydesc;

// Inline fn used regularly elsewhere.

static inline size_t
next_power_of_two(size_t s)
{
size_t tmp = s - 1;
tmp |= tmp >> 1;
tmp |= tmp >> 2;
tmp |= tmp >> 4;
tmp |= tmp >> 8;
tmp |= tmp >> 16;
#ifdef _LP64
tmp |= tmp >> 32;
#endif
return tmp + 1;
}

// Rounds |size| to the nearest |alignment|. Invariant: |alignment| is a power
// of two.
template<typename T>
Expand Down Expand Up @@ -91,10 +76,6 @@ inline void reserve_vec_exact(rust_task* task, rust_vec_box** vpp,
}
}

inline void reserve_vec(rust_task* task, rust_vec_box** vpp, size_t size) {
reserve_vec_exact(task, vpp, next_power_of_two(size));
}

typedef rust_vec_box rust_str;

inline rust_str *
Expand Down