]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/data_roots.hpp
Put brackets around ipv6 addresses in `inet6 present`
[factor.git] / vm / data_roots.hpp
index 9f26556ea05cc272b413cf0bdca84b9ce44ecbfe..c0e4ce68f36fdfb018547ef8e73fdf01480f2d59 100644 (file)
@@ -14,18 +14,10 @@ template <typename Type> struct data_root : public tagged<Type> {
 
   data_root(Type* value, factor_vm* parent)
       : tagged<Type>(value), parent(parent) {
+    FACTOR_ASSERT(value);
     push();
   }
 
-  const data_root<Type>& operator=(const Type* x) {
-    tagged<Type>::operator=(x);
-    return *this;
-  }
-  const data_root<Type>& operator=(const cell& x) {
-    tagged<Type>::operator=(x);
-    return *this;
-  }
-
   ~data_root() {
     parent->data_roots.pop_back();
   }
@@ -37,27 +29,4 @@ template <typename Type> struct data_root : public tagged<Type> {
   }
 };
 
-/* A similar hack for the bignum implementation */
-struct gc_bignum {
-  bignum** addr;
-  factor_vm* parent;
-
-  gc_bignum(bignum** addr, factor_vm* parent) : addr(addr), parent(parent) {
-    /* Don't bother with variables holding NULL pointers. */
-    if (*addr) {
-      parent->check_data_pointer(*addr);
-      parent->bignum_roots.push_back(addr);
-    }
-  }
-
-  ~gc_bignum() {
-    if (*addr) {
-      FACTOR_ASSERT(parent->bignum_roots.back() == addr);
-      parent->bignum_roots.pop_back();
-    }
-  }
-};
-
-#define GC_BIGNUM(x) gc_bignum x##__data_root(&x, this)
-
 }