go-defer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* go-defer.h -- the defer stack.
  2. Copyright 2010 The Go Authors. All rights reserved.
  3. Use of this source code is governed by a BSD-style
  4. license that can be found in the LICENSE file. */
  5. struct __go_panic_stack;
  6. /* The defer stack is a list of these structures. */
  7. struct __go_defer_stack
  8. {
  9. /* The next entry in the stack. */
  10. struct __go_defer_stack *__next;
  11. /* The stack variable for the function which called this defer
  12. statement. This is set to 1 if we are returning from that
  13. function, 0 if we are panicing through it. */
  14. _Bool *__frame;
  15. /* The value of the panic stack when this function is deferred.
  16. This function can not recover this value from the panic stack.
  17. This can happen if a deferred function has a defer statement
  18. itself. */
  19. struct __go_panic_stack *__panic;
  20. /* The function to call. */
  21. void (*__pfn) (void *);
  22. /* The argument to pass to the function. */
  23. void *__arg;
  24. /* The return address that a recover thunk matches against. This is
  25. set by __go_set_defer_retaddr which is called by the thunks
  26. created by defer statements. */
  27. const void *__retaddr;
  28. /* Set to true if a function created by reflect.MakeFunc is
  29. permitted to recover. The return address of such a function
  30. function will be somewhere in libffi, so __retaddr is not
  31. useful. */
  32. _Bool __makefunc_can_recover;
  33. /* Set to true if this defer stack entry is not part of the defer
  34. pool. */
  35. _Bool __special;
  36. };