Add a malloc_dyn upcall for dynamically sized allocations on the shared heap.

This commit is contained in:
Michael Sullivan
2012-06-13 17:59:21 -07:00
parent 31f4b63dff
commit 4c0d41cffa
7 changed files with 103 additions and 40 deletions

View File

@@ -104,6 +104,13 @@ make_str_vec(rust_kernel* kernel, size_t nstrs, char **strs) {
return v;
}
inline size_t get_box_size(size_t body_size, size_t body_align) {
size_t header_size = sizeof(rust_opaque_box);
// FIXME: This alignment calculation is suspicious. Is it right?
size_t total_size = align_to(header_size, body_align) + body_size;
return total_size;
}
// Initialization helpers for ISAAC RNG
inline void isaac_seed(rust_kernel* kernel, uint8_t* dest)