OSDN Git Service

f8924f3b63adb568c6e58d521ab5d49f1772993c
[pf3gnuchains/gcc-fork.git] / libgo / runtime / go-defer.h
1 /* go-defer.h -- the defer stack.
2
3    Copyright 2010 The Go Authors. All rights reserved.
4    Use of this source code is governed by a BSD-style
5    license that can be found in the LICENSE file.  */
6
7 struct __go_panic_stack;
8
9 /* The defer stack is a list of these structures.  */
10
11 struct __go_defer_stack
12 {
13   /* The next entry in the stack.  */
14   struct __go_defer_stack *__next;
15
16   /* The frame pointer for the function which called this defer
17      statement.  */
18   void *__frame;
19
20   /* The value of the panic stack when this function is deferred.
21      This function can not recover this value from the panic stack.
22      This can happen if a deferred function uses its own defer
23      statement.  */
24   struct __go_panic_stack *__panic;
25
26   /* The function to call.  */
27   void (*__pfn) (void *);
28
29   /* The argument to pass to the function.  */
30   void *__arg;
31
32   /* The return address that a recover thunk matches against.  This is
33      set by __go_set_defer_retaddr which is called by the thunks
34      created by defer statements.  */
35   const void *__retaddr;
36 };