about summary refs log tree commit diff
path: root/src/rt/rust_crate_cache.cpp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-08-25 14:20:21 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-08-25 14:21:05 -0700
commit8bd019bdc868e9d563aa72acbb0307deaeca919f (patch)
treedeadfaf2682bb480816d56526d7113a7be7ea3e2 /src/rt/rust_crate_cache.cpp
parent608f7ccded67fd65d5e12ef2c0601170fb3345ed (diff)
downloadrust-8bd019bdc868e9d563aa72acbb0307deaeca919f.tar.gz
rust-8bd019bdc868e9d563aa72acbb0307deaeca919f.zip
rt: Remember the number of captured type descriptors for objects in the type descriptor crate cache
Diffstat (limited to 'src/rt/rust_crate_cache.cpp')
-rw-r--r--src/rt/rust_crate_cache.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rt/rust_crate_cache.cpp b/src/rt/rust_crate_cache.cpp
index ba5a104b024..035715d219f 100644
--- a/src/rt/rust_crate_cache.cpp
+++ b/src/rt/rust_crate_cache.cpp
@@ -1,5 +1,6 @@
 
 #include "rust_internal.h"
+#include <algorithm>
 
 type_desc *
 rust_crate_cache::get_type_desc(size_t size,
@@ -14,6 +15,10 @@ rust_crate_cache::get_type_desc(size_t size,
     HASH_FIND(hh, this->type_descs, descs, keysz, td);
     if (td) {
         DLOG(sched, cache, "rust_crate_cache::get_type_desc hit");
+
+        // FIXME: This is a gross hack.
+        td->n_obj_params = std::max(td->n_obj_params, n_obj_params);
+
         return td;
     }
     DLOG(sched, cache, "rust_crate_cache::get_type_desc miss");