From 476a63b817b405cb89c150ce154fc898721baf06 Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 15 Apr 2015 22:41:34 -0400 Subject: [PATCH] move the Valgrind doc-comments to Rust-land, where they actually matter --- src/valgrind.c | 10 ---------- src/valgrind.rs | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/valgrind.c b/src/valgrind.c index 05d7af5..42362d3 100644 --- a/src/valgrind.c +++ b/src/valgrind.c @@ -1,22 +1,12 @@ #include #include "valgrind/valgrind.h" -// In order for Valgrind to keep track of stack overflows and such, it needs -// a little help. That help unfortunately comes in the form of a pair of C -// macros. Calling out to un-inlineable C code for this is pointlessly slow, -// but that's the way it is for now. - typedef uint32_t valgrind_stack_id_t; -// Register a stack with Valgrind. Returns an integer ID that can -// be used to deregister the stack when it's deallocated. -// `start < end`, though Valgrind will happily accept either. valgrind_stack_id_t valgrind_stack_register(const void *start, const void *end) { return VALGRIND_STACK_REGISTER(start, end); } -// Deregister a stack from Valgrind. Takes the integer ID that was returned -// on registration. void valgrind_stack_deregister(valgrind_stack_id_t id) { VALGRIND_STACK_DEREGISTER(id); } diff --git a/src/valgrind.rs b/src/valgrind.rs index 18a45f9..f1d5e10 100644 --- a/src/valgrind.rs +++ b/src/valgrind.rs @@ -1,9 +1,19 @@ #![allow(non_camel_case_types)] +//! In order for Valgrind to keep track of stack overflows and such, it needs +//! a little help. That help unfortunately comes in the form of a pair of C +//! macros. Calling out to un-inlineable C code for this is pointlessly slow, +//! but that's the way it is for now. pub type stack_id_t = u32; extern "C" { #[link_name = "valgrind_stack_register"] + /// Register a stack with Valgrind. Returns an integer ID that can + /// be used to deregister the stack when it's deallocated. + /// `start < end`, though Valgrind will happily accept either. pub fn stack_register(start: *const u8, end: *const u8) -> stack_id_t; + #[link_name = "valgrind_stack_deregister"] + /// Deregister a stack from Valgrind. Takes the integer ID that was returned + /// on registration. pub fn stack_deregister(id: stack_id_t); }