Skip to content

Instantly share code, notes, and snippets.

@dbp
Created August 24, 2012 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbp/3456960 to your computer and use it in GitHub Desktop.
Save dbp/3456960 to your computer and use it in GitHub Desktop.
visiting vectors
fn visit_evec_uniq(_mtbl: uint, _inner: *tydesc) -> bool {
self.out += ~"~[";
self.align_to::<~[u8]>();
self.visit_unboxed_vec(_mtbl, _inner);
self.bump_past::<~[u8]>();
self.out += ~"]";
true
}
fn visit_unboxed_vec(_mtbl: uint, _inner: *tydesc) -> bool {
error!("visiting unboxed vec");
let uvr: unboxed_vec_repr;
unsafe {
let p = *(self.ptr as *u8); // c_void is uncopiable
uvr = *(p as *unboxed_vec_repr);
}
error!("%?", uvr);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment