Lines Matching refs:root

63  * A "root" pword must always exist. For properties it is
67 * root pword. The root value points to the second pword of
71 * CAUTION: if the root pword has the PERSISTENT bit set, it may
97 * root |-------| > 1 pword header
105 * are no such references. The root word never has such references.
113 #define IsNonpersistentHeaptermRoot(root) \
114 (ISPointer((root)->tag.kernel) \
115 && !IsSelfRef(root) \
116 && !IsPersistent((root)->tag))
795 make_heapterm_persistent(pword *root)
797 if (IsNonpersistentHeaptermRoot(root))
799 pword *pw = root->val.ptr;
803 /* CAUTION: by setting the PERSISTENT bit in root->tag we lose the
804 * information that root->val.ptr points to a complete heap-copy block
808 root->tag.kernel |= PERSISTENT; /* mark whole term as persistent */
1050 mark_dids_from_heapterm(pword *root)
1052 if (IsNonpersistentHeaptermRoot(root))
1054 mark_dids_from_pwords(root->val.ptr,
1055 root->val.ptr + HeaptermSize(root->val.ptr)/sizeof(pword));
1058 mark_dids_from_pwords(root, root + 1);
1067 * free_heapterm(root,v,t) - free a heap term
1071 free_heapterm(pword *root)
1073 if (IsNonpersistentHeaptermRoot(root))
1081 handle_slot = HeaptermHandleTable(root->val.ptr);
1083 for( count = 0; count < HeaptermNumHandles(root->val.ptr);
1095 hg_free_size((generic_ptr) HeaptermHeader(root->val.ptr),
1096 HeaptermSize(root->val.ptr) +
1097 HeaptermNumHandles(root->val.ptr) * sizeof(value) +
1100 root->tag.kernel = TEND;
1105 * create_heapterm(root,v,t) - copy a prolog term to the general heap
1107 * root points to a prolog word on the heap,
1113 create_heapterm(pword *root, value v, type t)
1147 top = _copy_term_to_heap(v, IsRef(t) ? v.ptr->tag : t, pw, &handle_slot, root);
1176 set_string_n(pword *root, char *string, int len) /* string\0 + length */
1187 root->val.ptr = pw;
1188 root->tag.kernel = TSTRG;
1193 set_string(pword *root, char *string) /* NUL-terminated string */
1195 set_string_n(root, string, strlen(string));
1200 * get_heapterm(root, result) - get a prolog term from the heap
1202 * root points to the heap word representing the term.
1209 get_heapterm(pword *root, pword *result)
1212 if (ISPointer(root->tag.kernel))
1214 if (IsSelfRef(root))
1216 else if (IsPersistent(root->tag))
1217 result->val.all = root->val.all;
1220 pword *orig = root->val.ptr;
1232 result->val.all = root->val.all;
1234 result->tag.all = root->tag.all;
1239 * Move the root of a heap term
1372 pword root;
1375 create_heapterm(&root, v, t);
1376 if (ISPointer(root.tag.kernel))
1378 if (IsSelfRef(&root))
1380 else if (IsPersistent(root.tag))
1383 size = HeaptermSize(root.val.ptr);
1389 free_heapterm(&root);