2011-10-08 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / libgo / runtime / go-defer.h
blob0b20e8f6e7897dd5ef49ec9f4fd7796fd7504d15
1 /* go-defer.h -- the defer stack.
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. */
7 struct __go_panic_stack;
9 /* The defer stack is a list of these structures. */
11 struct __go_defer_stack
13 /* The next entry in the stack. */
14 struct __go_defer_stack *__next;
16 /* The stack variable for the function which called this defer
17 statement. This is set to 1 if we are returning from that
18 function, 0 if we are panicing through it. */
19 _Bool *__frame;
21 /* The value of the panic stack when this function is deferred.
22 This function can not recover this value from the panic stack.
23 This can happen if a deferred function uses its own defer
24 statement. */
25 struct __go_panic_stack *__panic;
27 /* The function to call. */
28 void (*__pfn) (void *);
30 /* The argument to pass to the function. */
31 void *__arg;
33 /* The return address that a recover thunk matches against. This is
34 set by __go_set_defer_retaddr which is called by the thunks
35 created by defer statements. */
36 const void *__retaddr;