6 void factor_vm::c_to_factor_toplevel(cell quot) { c_to_factor(quot); }
8 void factor_vm::init_signals() { unix_init_signals(); }
12 #define SUFFIX ".image"
15 // You must free() the result yourself.
16 const char* default_image_path() {
17 const char* path = vm_executable_path();
20 return strdup("factor.image");
22 int len = strlen(path);
23 char* new_path = (char *)malloc(len + SUFFIX_LEN + 1);
24 memcpy(new_path, path, len);
25 memcpy(new_path + len, SUFFIX, SUFFIX_LEN + 1);
26 free(const_cast<char*>(path));
30 uint64_t nano_count() {
32 int ret = clock_gettime(CLOCK_MONOTONIC, &t);
34 fatal_error("clock_gettime failed", 0);
35 return (uint64_t)t.tv_sec * 1000000000 + t.tv_nsec;