1 #include "shotgun/lib/shotgun.h"
2 #include "shotgun/lib/sendsite.h"
3 #include "shotgun/lib/selector.h"
5 void send_site_cleanup(STATE
, OBJECT obj
) {
9 void send_site_init(STATE
) {
10 struct type_info info
= {
11 .object_fields
= SEND_SITE_OBJECT_FIELDS
,
12 .cleanup
= send_site_cleanup
15 BASIC_CLASS(send_site
) = rbs_class_new(state
, "SendSite", 0, BASIC_CLASS(object
));
16 class_set_object_type(BASIC_CLASS(send_site
), I2N(SendSiteType
));
18 state_setup_type(state
, SendSiteType
, &info
);
22 send site created with the following information:
25 * method lookup function reference
26 * reference to CompiledMethod containing send site
29 OBJECT
send_site_create(STATE
, OBJECT name
) {
33 NEW_STRUCT(ss_obj
, ss
, BASIC_CLASS(send_site
), struct send_site
);
36 SET_STRUCT_FIELD(ss_obj
, ss
->selector
, selector_lookup(state
, name
));
37 ss
->data1
= ss
->data2
= ss
->data3
= Qnil
;
38 ss
->hits
= ss
->misses
= 0;
40 cpu_initialize_sendsite(state
, ss
);
42 selector_associate(state
, ss
->selector
, ss_obj
);
47 /* cm is CompiledMethod that holds send site */
48 void send_site_set_sender(STATE
, OBJECT self
, OBJECT cm
) {
52 SET_STRUCT_FIELD(self
, ss
->sender
, cm
);