Can I insert checkpoints in a function, including any function it calls?

Can I insert checkpoints in a function, including any function it calls?

This looks like it has to be supported by the compiler, right?

fn check(){
   let useage = stacker.useage();
    print("stack usage {}",useage);
}

#[check_point(check())]
fn  A(){
     B();
}

fn B(){
C();
}

fn C(){

}

fn main(){
///  The check function is called back every time a function call occurs
   A(); 
/// will  print   stack usage 30,  stack usage 90,  stack usage 90
}


so i can check The current stack capacity

Where is this attribute coming from? It's not entirely clear what you're asking.

this attribute Is assuming

This cannot be supported, since some function called by the annotated one can be in other compilation units (or even in the external libraries).

The remaining stack space is currently available even if an external library is called. However, this function requires compiler support

I mean, it's impossible to instrument the function which is already compiled by something else.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.