about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2011-05-25 12:00:16 -0400
committerRafael Ávila de Espíndola <respindola@mozilla.com>2011-05-25 12:00:16 -0400
commit23c1335cb3cd022b95ebe1f7acfc8192c6f310cd (patch)
tree963348b4afb6735ead2ccbd65cb6a3484500337d
parent579b317ae8e4155c480b0d9426e54f4b98410997 (diff)
downloadrust-23c1335cb3cd022b95ebe1f7acfc8192c6f310cd.tar.gz
rust-23c1335cb3cd022b95ebe1f7acfc8192c6f310cd.zip
Dead code.
-rw-r--r--src/rt/rust_crate_cache.cpp45
-rw-r--r--src/rt/rust_internal.h14
2 files changed, 2 insertions, 57 deletions
diff --git a/src/rt/rust_crate_cache.cpp b/src/rt/rust_crate_cache.cpp
index 160fedb4349..e7b187ef225 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 38428f93f91..30fc4637bed 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<rust_crate_cache>,
                    public rc_base<rust_crate_cache>
 {
 public:
-    class lib :
-        public rc_base<lib>, public dom_owned<lib>
-    {
-        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: