w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gc.h
Go to the documentation of this file.
1 /**
2 ** @file mruby/gc.h - garbage collector for mruby
3 **
4 ** See Copyright Notice in mruby.h
5 */
6 
7 #ifndef MRUBY_GC_H
8 #define MRUBY_GC_H
9 
10 #include "common.h"
11 
12 /**
13  * Uncommon memory management stuffs.
14  */
16 
17 
18 struct mrb_state;
19 
20 #define MRB_EACH_OBJ_OK 0
21 #define MRB_EACH_OBJ_BREAK 1
22 typedef int (mrb_each_object_callback)(struct mrb_state *mrb, struct RBasic *obj, void *data);
23 void mrb_objspace_each_objects(struct mrb_state *mrb, mrb_each_object_callback *callback, void *data);
24 size_t mrb_objspace_page_slot_size(void);
25 MRB_API void mrb_free_context(struct mrb_state *mrb, struct mrb_context *c);
26 
27 #ifndef MRB_GC_ARENA_SIZE
28 #define MRB_GC_ARENA_SIZE 100
29 #endif
30 
31 typedef enum {
36 
37 /* Disable MSVC warning "C4200: nonstandard extension used: zero-sized array
38  * in struct/union" when in C++ mode */
39 #ifdef _MSC_VER
40 #pragma warning(push)
41 #pragma warning(disable : 4200)
42 #endif
43 
44 typedef struct mrb_heap_page {
45  struct RBasic *freelist;
51  void *objects[];
53 
54 #ifdef _MSC_VER
55 #pragma warning(pop)
56 #endif
57 
58 typedef struct mrb_gc {
59  mrb_heap_page *heaps; /* heaps for GC */
62  size_t live; /* count of live objects */
63 #ifdef MRB_GC_FIXED_ARENA
64  struct RBasic *arena[MRB_GC_ARENA_SIZE]; /* GC protection array */
65 #else
66  struct RBasic **arena; /* GC protection array */
68 #endif
69  int arena_idx;
70 
71  mrb_gc_state state; /* state of gc */
72  int current_white_part; /* make white object by white_part */
73  struct RBasic *gray_list; /* list of gray objects to be traversed incrementally */
74  struct RBasic *atomic_gray_list; /* list of objects to be traversed atomically */
76  size_t threshold;
86 
88 mrb_object_dead_p(struct mrb_state *mrb, struct RBasic *object);
89 
91 
92 #endif /* MRUBY_GC_H */
struct rect data
Definition: dvipdfm.c:64
mrb_gc_state
Definition: gc.h:31
@ MRB_GC_STATE_ROOT
Definition: gc.h:32
@ MRB_GC_STATE_SWEEP
Definition: gc.h:34
@ MRB_GC_STATE_MARK
Definition: gc.h:33
mrb_bool mrb_object_dead_p(struct mrb_state *mrb, struct RBasic *object)
Definition: gc.c:320
struct mrb_heap_page mrb_heap_page
#define MRB_GC_ARENA_SIZE
Definition: gc.h:28
struct mrb_gc mrb_gc
void mrb_objspace_each_objects(struct mrb_state *mrb, mrb_each_object_callback *callback, void *data)
Definition: gc.c:1588
int() mrb_each_object_callback(struct mrb_state *mrb, struct RBasic *obj, void *data)
Definition: gc.h:22
void mrb_free_context(struct mrb_state *mrb, struct mrb_context *c)
Definition: state.c:171
size_t mrb_objspace_page_slot_size(void)
Definition: gc.c:1615
#define c(n)
Definition: gpos-common.c:150
#define MRB_END_DECL
Definition: common.h:28
#define MRB_BEGIN_DECL
Definition: common.h:26
#define MRB_API
Definition: common.h:73
Definition: object.h:19
Definition: gc.h:58
int current_white_part
Definition: gc.h:72
size_t threshold
Definition: gc.h:76
mrb_gc_state state
Definition: gc.h:71
mrb_bool full
Definition: gc.h:81
mrb_bool disabled
Definition: gc.h:80
mrb_heap_page * heaps
Definition: gc.h:59
mrb_heap_page * sweeps
Definition: gc.h:60
mrb_bool generational
Definition: gc.h:82
struct RBasic * atomic_gray_list
Definition: gc.h:74
int arena_idx
Definition: gc.h:69
size_t majorgc_old_threshold
Definition: gc.h:84
size_t live
Definition: gc.h:62
int interval_ratio
Definition: gc.h:77
int arena_capa
Definition: gc.h:67
int step_ratio
Definition: gc.h:78
struct RBasic ** arena
Definition: gc.h:66
mrb_heap_page * free_heaps
Definition: gc.h:61
mrb_bool iterating
Definition: gc.h:79
size_t live_after_mark
Definition: gc.h:75
mrb_bool out_of_memory
Definition: gc.h:83
struct RBasic * gray_list
Definition: gc.h:73
struct mrb_heap_page * prev
Definition: gc.h:46
struct mrb_heap_page * next
Definition: gc.h:47
struct mrb_heap_page * free_prev
Definition: gc.h:49
struct mrb_heap_page * free_next
Definition: gc.h:48
struct RBasic * freelist
Definition: gc.h:45
mrb_bool old
Definition: gc.h:50
void * objects[]
Definition: gc.h:51
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)