Skip to content

Commit 3d9101b

Browse files
committed
---
yaml --- r: 2777 b: refs/heads/master c: 579b317 h: refs/heads/master i: 2775: 9815936 v: v3
1 parent a1090a7 commit 3d9101b

File tree

3 files changed

+3
-64
lines changed

3 files changed

+3
-64
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 3eafea46a3f66f28c358a50f97005e0893efd8b8
2+
refs/heads/master: 579b317ae8e4155c480b0d9426e54f4b98410997

trunk/src/rt/rust_crate_cache.cpp

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -31,40 +31,6 @@ rust_crate_cache::lib::get_handle() {
3131
return handle;
3232
}
3333

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-
6834
static inline void
6935
adjust_disp(uintptr_t &disp, const void *oldp, const void *newp)
7036
{
@@ -113,32 +79,19 @@ rust_crate_cache::get_type_desc(size_t size,
11379

11480
rust_crate_cache::rust_crate_cache(rust_dom *dom,
11581
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)),
11883
type_descs(NULL),
11984
crate(crate),
12085
dom(dom),
12186
idx(0)
12287
{
123-
I(dom, c_syms);
12488
I(dom, libs);
12589
}
12690

12791
void
12892
rust_crate_cache::flush() {
12993
DLOG(dom, cache, "rust_crate_cache::flush()");
13094

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-
14295
for (size_t i = 0; i < crate->n_libs; ++i) {
14396
lib *l = libs[i];
14497
if (l) {
@@ -160,7 +113,6 @@ rust_crate_cache::flush() {
160113
rust_crate_cache::~rust_crate_cache()
161114
{
162115
flush();
163-
dom->free(c_syms);
164116
dom->free(libs);
165117
}
166118

trunk/src/rt/rust_internal.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class rust_crate {
240240
public:
241241

242242
size_t pad6;
243-
size_t n_c_syms;
243+
size_t pad7;
244244
size_t n_libs;
245245

246246
// Crates are immutable, constructed by the compiler.
@@ -297,26 +297,13 @@ rust_crate_cache : public dom_owned<rust_crate_cache>,
297297
~lib();
298298
};
299299

300-
class c_sym :
301-
public rc_base<c_sym>, public dom_owned<c_sym>
302-
{
303-
uintptr_t val;
304-
lib *library;
305-
public:
306-
rust_dom *dom;
307-
c_sym(rust_dom *dom, lib *library, char const *name);
308-
uintptr_t get_val();
309-
~c_sym();
310-
};
311-
312300
type_desc *get_type_desc(size_t size,
313301
size_t align,
314302
size_t n_descs,
315303
type_desc const **descs);
316304

317305
private:
318306

319-
c_sym **c_syms;
320307
lib **libs;
321308
type_desc *type_descs;
322309

0 commit comments

Comments
 (0)