-
Notifications
You must be signed in to change notification settings - Fork 1
/
allocate.go
57 lines (51 loc) · 854 Bytes
/
allocate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package mruby
func (mrb *State) AllocClass() *Class {
return &Class{
class: class{
Object: Object{
class: mrb.ClassClass,
},
},
}
}
func (mrb *State) AllocSingletonClass() *SingletonClass {
return &SingletonClass{
class: class{
Object: Object{
class: mrb.ClassClass,
},
},
}
}
func (mrb *State) AllocInheritClass() *InheritClass {
return &InheritClass{
class: class{
Object: Object{
class: mrb.ClassClass,
},
},
}
}
func (mrb *State) AllocModule() *Module {
return &Module{
class: class{
Object: Object{
class: mrb.ModuleClass,
},
},
}
}
func (mrb *State) AllocObject(class RClass) RObject {
return &Object{
class: class,
iv: nil,
}
}
func (mrb *State) AllocException(class RClass) RException {
return &Exception{
Object: Object{
class: class,
},
message: "",
}
}