~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to include/ruby/vm.h

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
  ruby/vm.h -
4
4
 
5
 
  $Author: nobu $
 
5
  $Author: shyouhei $
6
6
  created at: Sat May 31 15:17:36 2008
7
7
 
8
8
  Copyright (C) 2008 Yukihiro Matsumoto
19
19
#endif
20
20
#endif
21
21
 
 
22
#if defined __GNUC__ && __GNUC__ >= 4
 
23
#pragma GCC visibility push(default)
 
24
#endif
 
25
 
22
26
/* Place holder.
23
27
 *
24
28
 * We will prepare VM creation/control APIs on 1.9.2 or later.
32
36
/* core API */
33
37
int ruby_vm_destruct(ruby_vm_t *vm);
34
38
 
 
39
/**
 
40
 * ruby_vm_at_exit registers a function _func_ to be invoked when a VM
 
41
 * passed away.  Functions registered this way runs in reverse order
 
42
 * of registration, just like END {} block does.  The difference is
 
43
 * its timing to be triggered. ruby_vm_at_exit functions runs when a
 
44
 * VM _passed_ _away_, while END {} blocks runs just _before_ a VM
 
45
 * _is_ _passing_ _away_.
 
46
 *
 
47
 * You cannot register a function to another VM than where you are in.
 
48
 * So where to register is intuitive, omitted.  OTOH the argument
 
49
 * _func_ cannot know which VM it is in because at the time of
 
50
 * invocation, the VM has already died and there is no execution
 
51
 * context.  The VM itself is passed as the first argument to it.
 
52
 *
 
53
 * @param[in] func the function to register.
 
54
 */
 
55
void ruby_vm_at_exit(void(*func)(ruby_vm_t *));
 
56
 
 
57
#if defined __GNUC__ && __GNUC__ >= 4
 
58
#pragma GCC visibility pop
 
59
#endif
 
60
 
35
61
#if defined(__cplusplus)
36
62
#if 0
37
63
{ /* satisfy cc-mode */