summaryrefslogtreecommitdiff
path: root/include/ruby/vm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/vm.h')
-rw-r--r--include/ruby/vm.h67
1 files changed, 32 insertions, 35 deletions
diff --git a/include/ruby/vm.h b/include/ruby/vm.h
index 73345264bd..8779780952 100644
--- a/include/ruby/vm.h
+++ b/include/ruby/vm.h
@@ -1,37 +1,34 @@
-/**********************************************************************
-
- ruby/vm.h -
-
- $Author$
- created at: Sat May 31 15:17:36 2008
-
- Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_VM_H
+#ifndef RUBY_VM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_VM_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-RUBY_SYMBOL_EXPORT_BEGIN
-
-/* Place holder.
+/**
+ * @file
+ * @author $Author$
+ * @date Sat May 31 15:17:36 2008
+ * @copyright Copyright (C) 2008 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
*
- * We will prepare VM creation/control APIs on 1.9.2 or later.
- * If you have an interest about it, please see mvm branch.
- * http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/mvm/
+ * We planned to have multiple VMs run side-by-side. The API here was a
+ * preparation of that feature. The topic branch was eventually abandoned, and
+ * we now have Ractor. This file is kind of obsolescent.
*/
+#include "ruby/internal/dllexport.h"
-/* VM type declaration */
+RBIMPL_SYMBOL_EXPORT_BEGIN()
+
+/**
+ * The opaque struct to hold VM internals. Its fields are intentionally hidden
+ * from extension libraries because it changes drastically time to time.
+ */
typedef struct rb_vm_struct ruby_vm_t;
-/* core API */
+/**
+ * Destructs the passed VM. You don't have to call this API directly now,
+ * because there is no way to create one. There is only one VM at one time.
+ * ruby_stop() should just suffice.
+ */
int ruby_vm_destruct(ruby_vm_t *vm);
/**
@@ -52,13 +49,13 @@ int ruby_vm_destruct(ruby_vm_t *vm);
*/
void ruby_vm_at_exit(void(*func)(ruby_vm_t *));
-RUBY_SYMBOL_EXPORT_END
+/**
+ * Returns whether the Ruby VM will free all memory at shutdown.
+ *
+ * @return true if free-at-exit is enabled, false otherwise.
+ */
+bool ruby_free_at_exit_p(void);
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
+RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY_VM_H */