servo / rust-mozjs

DEPRECATED - moved to servo/mozjs instead.
Mozilla Public License 2.0
293 stars 117 forks source link

Add glue to use SpiderMonkey's memory reporting from Rust code. #177

Closed nnethercote closed 9 years ago

nnethercote commented 9 years ago

This cannot land until https://github.com/servo/mozjs/pull/49 has landed. And it must land before https://github.com/servo/servo/pull/6572 can land.

michaelwu commented 9 years ago

For this particular API, C++ glue is not necessary. https://github.com/michaelwu/rust-bindgen/tree/sm-hacks along with https://github.com/michaelwu/llvm and https://github.com/michaelwu/clang will do the trick. I can generate some bindings for you if you want - it's a bit of a hassle to setup bindgen.

michaelwu commented 9 years ago

For reference, https://gist.github.com/michaelwu/9f10f60dc8b2c8e881cd is the bindgen output on MemoryMetrics.h (without your sm patch). Needs a bit of cleanup to work, especially since this file seems to trigger a few new features I haven't fully tested yet. Constructing and destructing C++ objects may require C++ glue, but many other things can be covered by the generator.

jdm commented 9 years ago

@bors-servo: r+

bors-servo commented 9 years ago

:pushpin: Commit a802d31 has been approved by jdm

bors-servo commented 9 years ago

:hourglass: Testing commit a802d31 with merge 9509978...

bors-servo commented 9 years ago

:sunny: Test successful - cargo-linux, cargo-mac