Skip to content

Commit 5086c08

Browse files
committed
std::rt: Update GC metadata in init
1 parent e1555f9 commit 5086c08

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/libstd/rt/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ pub fn start(_argc: int, _argv: **u8, crate_map: *u8, main: ~fn()) -> int {
186186
/// based on the RUST_LOG environment variable.
187187
pub fn init(crate_map: *u8) {
188188
logging::init(crate_map);
189+
unsafe { rust_update_gc_metadata(crate_map) }
190+
191+
extern {
192+
fn rust_update_gc_metadata(crate_map: *u8);
193+
}
189194
}
190195

191196
/// One-time runtime cleanup.

src/rt/rust_gc_metadata.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ rust_gc_metadata() {
7979
return (void *)global_safe_points;
8080
}
8181

82+
extern "C" CDECL void
83+
rust_update_gc_metadata(const void* map) {
84+
update_gc_metadata(map);
85+
}
86+
8287
//
8388
// Local Variables:
8489
// mode: C++

src/rt/rustrt.def.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ rust_call_tydesc_glue
178178
tdefl_compress_mem_to_heap
179179
tinfl_decompress_mem_to_heap
180180
rust_gc_metadata
181+
rust_update_gc_metadata
181182
rust_uv_ip4_port
182183
rust_uv_ip6_port
183184
rust_uv_tcp_getpeername

0 commit comments

Comments
 (0)