diff options
| author | Rafael Ávila de Espíndola <respindola@mozilla.com> | 2011-05-25 11:45:07 -0400 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <respindola@mozilla.com> | 2011-05-25 11:45:07 -0400 |
| commit | 579b317ae8e4155c480b0d9426e54f4b98410997 (patch) | |
| tree | 717729796d837c2f9d6513a91e0b5b553fc8130c /src/rt/rust_crate_cache.cpp | |
| parent | 3eafea46a3f66f28c358a50f97005e0893efd8b8 (diff) | |
| download | rust-579b317ae8e4155c480b0d9426e54f4b98410997.tar.gz rust-579b317ae8e4155c480b0d9426e54f4b98410997.zip | |
Dead code.
Diffstat (limited to 'src/rt/rust_crate_cache.cpp')
| -rw-r--r-- | src/rt/rust_crate_cache.cpp | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/rt/rust_crate_cache.cpp b/src/rt/rust_crate_cache.cpp index 0f4ffad1b37..160fedb4349 100644 --- a/src/rt/rust_crate_cache.cpp +++ b/src/rt/rust_crate_cache.cpp @@ -31,40 +31,6 @@ rust_crate_cache::lib::get_handle() { return handle; } - - -rust_crate_cache::c_sym::c_sym(rust_dom *dom, lib *library, char const *name) - : val(0), - library(library), - dom(dom) -{ - library->ref(); - uintptr_t handle = library->get_handle(); - if (handle) { -#if defined(__WIN32__) - val = (uintptr_t)GetProcAddress((HMODULE)handle, _T(name)); -#else - val = (uintptr_t)dlsym((void*)handle, name); -#endif - DLOG(dom, cache, "resolved symbol '%s' to 0x%" PRIxPTR, - name, val); - } else { - DLOG_ERR(dom, cache, "unresolved symbol '%s', null lib handle\n" - "(did you omit a -L flag?)", name); - } -} - -rust_crate_cache::c_sym::~c_sym() { - DLOG(dom, cache, - "~rust_crate_cache::c_sym(0x%" PRIxPTR ")", val); - library->deref(); -} - -uintptr_t -rust_crate_cache::c_sym::get_val() { - return val; -} - static inline void adjust_disp(uintptr_t &disp, const void *oldp, const void *newp) { @@ -113,14 +79,12 @@ rust_crate_cache::get_type_desc(size_t size, rust_crate_cache::rust_crate_cache(rust_dom *dom, rust_crate const *crate) - : c_syms((c_sym**) dom->calloc(sizeof(c_sym*) * crate->n_c_syms)), - libs((lib**) dom->calloc(sizeof(lib*) * crate->n_libs)), + : libs((lib**) dom->calloc(sizeof(lib*) * crate->n_libs)), type_descs(NULL), crate(crate), dom(dom), idx(0) { - I(dom, c_syms); I(dom, libs); } @@ -128,17 +92,6 @@ void rust_crate_cache::flush() { DLOG(dom, cache, "rust_crate_cache::flush()"); - for (size_t i = 0; i < crate->n_c_syms; ++i) { - c_sym *s = c_syms[i]; - if (s) { - DLOG(dom, cache, - "rust_crate_cache::flush() deref c_sym %" - PRIdPTR " (rc=%" PRIdPTR ")", i, s->ref_count); - s->deref(); - } - c_syms[i] = NULL; - } - for (size_t i = 0; i < crate->n_libs; ++i) { lib *l = libs[i]; if (l) { @@ -160,7 +113,6 @@ rust_crate_cache::flush() { rust_crate_cache::~rust_crate_cache() { flush(); - dom->free(c_syms); dom->free(libs); } |
