diff options
| author | bors <bors@rust-lang.org> | 2013-07-15 21:01:20 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-15 21:01:20 -0700 |
| commit | 274e7a4e4999fe4e59a8ab0d71555f7f3eea3d6f (patch) | |
| tree | 8ebad07a9b590b0e627ebb323423072bbb136f6e /src/rt | |
| parent | 47ba4583dbf234c4a080496715700c0878472a78 (diff) | |
| parent | e118555ce67aadb0a58039b3e74f44a43b210528 (diff) | |
| download | rust-274e7a4e4999fe4e59a8ab0d71555f7f3eea3d6f.tar.gz rust-274e7a4e4999fe4e59a8ab0d71555f7f3eea3d6f.zip | |
auto merge of #7816 : thestinger/rust/header, r=huonw
Note that the headers are still on `~[T]` when `T` is managed. This is continued from #7605, which removed all the code relying on the headers and removed them from `~T` for non-managed `T`.
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 6 | ||||
| -rw-r--r-- | src/rt/rust_util.h | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 18e5583a330..d70c2a91366 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -390,9 +390,9 @@ void tm_to_rust_tm(tm* in_tm, rust_tm* out_tm, int32_t gmtoff, if (zone != NULL) { size_t size = strlen(zone); reserve_vec_exact(&out_tm->tm_zone, size + 1); - memcpy(out_tm->tm_zone->body.data, zone, size); - out_tm->tm_zone->body.fill = size + 1; - out_tm->tm_zone->body.data[size] = '\0'; + memcpy(out_tm->tm_zone->data, zone, size); + out_tm->tm_zone->fill = size + 1; + out_tm->tm_zone->data[size] = '\0'; } } diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h index 242c2ef0a81..95651c68602 100644 --- a/src/rt/rust_util.h +++ b/src/rt/rust_util.h @@ -57,17 +57,17 @@ vec_data(rust_vec *v) { return reinterpret_cast<T*>(v->data); } -inline void reserve_vec_exact(rust_vec_box** vpp, +inline void reserve_vec_exact(rust_vec** vpp, size_t size) { - if (size > (*vpp)->body.alloc) { + if (size > (*vpp)->alloc) { rust_exchange_alloc exchange_alloc; - *vpp = (rust_vec_box*)exchange_alloc - .realloc(*vpp, size + sizeof(rust_vec_box)); - (*vpp)->body.alloc = size; + *vpp = (rust_vec*)exchange_alloc + .realloc(*vpp, size + sizeof(rust_vec)); + (*vpp)->alloc = size; } } -typedef rust_vec_box rust_str; +typedef rust_vec rust_str; inline size_t get_box_size(size_t body_size, size_t body_align) { size_t header_size = sizeof(rust_opaque_box); |
