@@ -31,40 +31,6 @@ rust_crate_cache::lib::get_handle() {
31
31
return handle;
32
32
}
33
33
34
-
35
-
36
- rust_crate_cache::c_sym::c_sym (rust_dom *dom, lib *library, char const *name)
37
- : val(0 ),
38
- library(library),
39
- dom(dom)
40
- {
41
- library->ref ();
42
- uintptr_t handle = library->get_handle ();
43
- if (handle) {
44
- #if defined(__WIN32__)
45
- val = (uintptr_t )GetProcAddress ((HMODULE)handle, _T (name));
46
- #else
47
- val = (uintptr_t )dlsym ((void *)handle, name);
48
- #endif
49
- DLOG (dom, cache, " resolved symbol '%s' to 0x%" PRIxPTR,
50
- name, val);
51
- } else {
52
- DLOG_ERR (dom, cache, " unresolved symbol '%s', null lib handle\n "
53
- " (did you omit a -L flag?)" , name);
54
- }
55
- }
56
-
57
- rust_crate_cache::c_sym::~c_sym () {
58
- DLOG (dom, cache,
59
- " ~rust_crate_cache::c_sym(0x%" PRIxPTR " )" , val);
60
- library->deref ();
61
- }
62
-
63
- uintptr_t
64
- rust_crate_cache::c_sym::get_val () {
65
- return val;
66
- }
67
-
68
34
static inline void
69
35
adjust_disp (uintptr_t &disp, const void *oldp, const void *newp)
70
36
{
@@ -113,32 +79,19 @@ rust_crate_cache::get_type_desc(size_t size,
113
79
114
80
rust_crate_cache::rust_crate_cache (rust_dom *dom,
115
81
rust_crate const *crate)
116
- : c_syms((c_sym**) dom->calloc(sizeof (c_sym*) * crate->n_c_syms)),
117
- libs((lib**) dom->calloc(sizeof (lib*) * crate->n_libs)),
82
+ : libs((lib**) dom->calloc(sizeof (lib*) * crate->n_libs)),
118
83
type_descs(NULL ),
119
84
crate(crate),
120
85
dom(dom),
121
86
idx(0 )
122
87
{
123
- I (dom, c_syms);
124
88
I (dom, libs);
125
89
}
126
90
127
91
void
128
92
rust_crate_cache::flush () {
129
93
DLOG (dom, cache, " rust_crate_cache::flush()" );
130
94
131
- for (size_t i = 0 ; i < crate->n_c_syms ; ++i) {
132
- c_sym *s = c_syms[i];
133
- if (s) {
134
- DLOG (dom, cache,
135
- " rust_crate_cache::flush() deref c_sym %"
136
- PRIdPTR " (rc=%" PRIdPTR " )" , i, s->ref_count );
137
- s->deref ();
138
- }
139
- c_syms[i] = NULL ;
140
- }
141
-
142
95
for (size_t i = 0 ; i < crate->n_libs ; ++i) {
143
96
lib *l = libs[i];
144
97
if (l) {
@@ -160,7 +113,6 @@ rust_crate_cache::flush() {
160
113
rust_crate_cache::~rust_crate_cache ()
161
114
{
162
115
flush ();
163
- dom->free (c_syms);
164
116
dom->free (libs);
165
117
}
166
118
0 commit comments