iree/vm/context.c
static iree_status_t iree_vm_context_notify_reverse(iree_vm_stack_t* stack,
                                                    iree_vm_context_t* context,
                                                    iree_vm_signal_t signal) {
  IREE_TRACE_ZONE_BEGIN(z0);
  iree_status_t status = iree_ok_status();
  for (int i = (int)context->list.count - 1; i >= 0; --i) {
    iree_vm_module_t* module = context->list.modules[i];
    iree_vm_module_state_t* module_state = context->list.module_states[i];

    // Call the user-level notify method first.
    // This allows users to drop any state that they can rematerialize and
    // return the resources to pools/caches to be trimmed below.
    status =
        iree_vm_context_call_module_notify(stack, module, module_state, signal);
    if (!iree_status_is_ok(status)) break;

    // Call the module internal interface notify method.
    // This handles the resources owned by the module implementation itself
    // such as JITed binaries or other module infrastructure. Since we've
    // already called the user-level function we likely have all of the
    // resources that could be returned to pools there for this to reclaim.
    status = module->notify(module->self, module_state, signal);
    if (!iree_status_is_ok(status)) break;
  }
  IREE_TRACE_ZONE_END(z0);
  return status;
}
// Calls the module notify methods in reverse registration order.
Calls the module notify methods in reverse registration order.
Calls the module notify methods in reverse registration order .
static iree_status_t iree_vm_context_notify_reverse(iree_vm_stack_t* stack,
                                                    iree_vm_context_t* context,
                                                    iree_vm_signal_t signal) {
  IREE_TRACE_ZONE_BEGIN(z0);
  iree_status_t status = iree_ok_status();
  for (int i = (int)context->list.count - 1; i >= 0; --i) {
    iree_vm_module_t* module = context->list.modules[i];
    iree_vm_module_state_t* module_state = context->list.module_states[i];
    status =
        iree_vm_context_call_module_notify(stack, module, module_state, signal);
    if (!iree_status_is_ok(status)) break;
    status = module->notify(module->self, module_state, signal);
    if (!iree_status_is_ok(status)) break;
  }
  IREE_TRACE_ZONE_END(z0);
  return status;
}
static iree_status_t iree_vm_context_notify_reverse ( iree_vm_stack_t * stack , iree_vm_context_t * context , iree_vm_signal_t signal ) { IREE_TRACE_ZONE_BEGIN ( z0 ) ; iree_status_t status = iree_ok_status ( ) ; for ( int i = ( int ) context -> list . count - 1 ; i >= 0 ; -- i ) { iree_vm_module_t * module = context -> list . modules [ i ] ; iree_vm_module_state_t * module_state = context -> list . module_states [ i ] ; status = iree_vm_context_call_module_notify ( stack , module , module_state , signal ) ; if ( ! iree_status_is_ok ( status ) ) break ; status = module -> notify ( module -> self , module_state , signal ) ; if ( ! iree_status_is_ok ( status ) ) break ; } IREE_TRACE_ZONE_END ( z0 ) ; return status ; }
Calls the module notify methods in reverse registration order.
Calls the module notify methods in reverse registration order .
// Call the user-level notify method first. // This allows users to drop any state that they can rematerialize and // return the resources to pools/caches to be trimmed below. // Call the module internal interface notify method. // This handles the resources owned by the module implementation itself // such as JITed binaries or other module infrastructure. Since we've // already called the user-level function we likely have all of the // resources that could be returned to pools there for this to reclaim.