From 23c1335cb3cd022b95ebe1f7acfc8192c6f310cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Wed, 25 May 2011 12:00:16 -0400 Subject: [PATCH] Dead code. --- src/rt/rust_crate_cache.cpp | 45 +------------------------------------ src/rt/rust_internal.h | 14 +----------- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/src/rt/rust_crate_cache.cpp b/src/rt/rust_crate_cache.cpp index 160fedb4349e..e7b187ef2255 100644 --- a/src/rt/rust_crate_cache.cpp +++ b/src/rt/rust_crate_cache.cpp @@ -1,36 +1,6 @@ #include "rust_internal.h" -rust_crate_cache::lib::lib(rust_dom *dom, char const *name) - : handle(0), - dom(dom) -{ -#if defined(__WIN32__) - handle = (uintptr_t)LoadLibrary(_T(name)); -#else - handle = (uintptr_t)dlopen(name, RTLD_GLOBAL|RTLD_LAZY); -#endif - DLOG(dom, cache, "loaded library '%s' as 0x%" PRIxPTR, - name, handle); -} - -rust_crate_cache::lib::~lib() { - DLOG(dom, cache, "~rust_crate_cache::lib(0x%" PRIxPTR ")", - handle); - if (handle) { -#if defined(__WIN32__) - FreeLibrary((HMODULE)handle); -#else - dlclose((void*)handle); -#endif - } -} - -uintptr_t -rust_crate_cache::lib::get_handle() { - return handle; -} - static inline void adjust_disp(uintptr_t &disp, const void *oldp, const void *newp) { @@ -79,29 +49,17 @@ rust_crate_cache::get_type_desc(size_t size, rust_crate_cache::rust_crate_cache(rust_dom *dom, rust_crate const *crate) - : libs((lib**) dom->calloc(sizeof(lib*) * crate->n_libs)), - type_descs(NULL), + : type_descs(NULL), crate(crate), dom(dom), idx(0) { - I(dom, libs); } void rust_crate_cache::flush() { DLOG(dom, cache, "rust_crate_cache::flush()"); - for (size_t i = 0; i < crate->n_libs; ++i) { - lib *l = libs[i]; - if (l) { - DLOG(dom, cache, "rust_crate_cache::flush() deref lib %" - PRIdPTR " (rc=%" PRIdPTR ")", i, l->ref_count); - l->deref(); - } - libs[i] = NULL; - } - while (type_descs) { type_desc *d = type_descs; HASH_DEL(type_descs, d); @@ -113,7 +71,6 @@ rust_crate_cache::flush() { rust_crate_cache::~rust_crate_cache() { flush(); - dom->free(libs); } // diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index 38428f93f91e..30fc4637bede 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -241,7 +241,7 @@ public: size_t pad6; size_t pad7; - size_t n_libs; + size_t pad8; // Crates are immutable, constructed by the compiler. @@ -286,17 +286,6 @@ rust_crate_cache : public dom_owned, public rc_base { public: - class lib : - public rc_base, public dom_owned - { - uintptr_t handle; - public: - rust_dom *dom; - lib(rust_dom *dom, char const *name); - uintptr_t get_handle(); - ~lib(); - }; - type_desc *get_type_desc(size_t size, size_t align, size_t n_descs, @@ -304,7 +293,6 @@ public: private: - lib **libs; type_desc *type_descs; public: