]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/gc_info.hpp
VM: the small return_address_index function can be implemented in the header
[factor.git] / vm / gc_info.hpp
index f5a25d2e3dfd200b22fdc2a997f15dab6cdcde8f..4a8bf849085dce1d27607d69c2a97dbfc8b959dd 100644 (file)
@@ -53,7 +53,16 @@ struct gc_info {
     return base_pointer_map()[index * derived_root_count + derived_root];
   }
 
-  cell return_address_index(cell return_address);
+  cell return_address_index(cell return_address) {
+    uint32_t* return_address_array = return_addresses();
+
+    for (cell i = 0; i < return_address_count; i++) {
+      if (return_address == return_address_array[i])
+        return i;
+    }
+
+    return (cell)-1;
+  }
 };
 
 }