about summary refs log tree commit diff
path: root/src/rt/rust_crate_cache.cpp
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 /src/rt/rust_crate_cache.cpp
parent579b317ae8e4155c480b0d9426e54f4b98410997 (diff)
downloadrust-23c1335cb3cd022b95ebe1f7acfc8192c6f310cd.tar.gz
rust-23c1335cb3cd022b95ebe1f7acfc8192c6f310cd.zip
Dead code.
Diffstat (limited to 'src/rt/rust_crate_cache.cpp')
-rw-r--r--src/rt/rust_crate_cache.cpp45
1 files changed, 1 insertions, 44 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);
 }
 
 //