From 74b2d9e19b2784aed009bd34aaeed43248944aca Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:11:30 -0700 Subject: [PATCH 01/11] rt: Remove last use of C++ exchange alloc --- src/libextra/time.rs | 5 ++++- src/rt/rust_builtin.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 257d941e4af..6119170f130 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -121,6 +121,9 @@ pub struct Tm { } pub fn empty_tm() -> Tm { + // 64 is the max size of the timezone buffer allocated on windows + // in rust_localtime. In glibc the max timezone size is supposedly 3. + let zone = str::with_capacity(64); Tm { tm_sec: 0_i32, tm_min: 0_i32, @@ -132,7 +135,7 @@ pub fn empty_tm() -> Tm { tm_yday: 0_i32, tm_isdst: 0_i32, tm_gmtoff: 0_i32, - tm_zone: ~"", + tm_zone: zone, tm_nsec: 0_i32, } } diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index de86035b632..d7cb0296a17 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -292,7 +292,7 @@ void tm_to_rust_tm(tm* in_tm, rust_tm* out_tm, int32_t gmtoff, if (zone != NULL) { size_t size = strlen(zone); - reserve_vec_exact(&out_tm->tm_zone, size); + assert(out_tm->tm_zone->alloc >= size); memcpy(out_tm->tm_zone->data, zone, size); out_tm->tm_zone->fill = size; } From b3fa43f6e0c94d39fc08846c53eac48e2903b97f Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:12:56 -0700 Subject: [PATCH 02/11] rt: Remove rust_exchange_alloc --- mk/rt.mk | 1 - src/rt/rust_exchange_alloc.cpp | 35 ---------------------------------- src/rt/rust_exchange_alloc.h | 24 ----------------------- src/rt/rust_util.h | 11 ----------- 4 files changed, 71 deletions(-) delete mode 100644 src/rt/rust_exchange_alloc.cpp delete mode 100644 src/rt/rust_exchange_alloc.h diff --git a/mk/rt.mk b/mk/rt.mk index f2a33bb1381..14bdbe6445c 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -75,7 +75,6 @@ RUNTIME_CXXS_$(1)_$(2) := \ rt/rust_gc_metadata.cpp \ rt/rust_util.cpp \ rt/rust_log.cpp \ - rt/rust_exchange_alloc.cpp \ rt/isaac/randport.cpp \ rt/miniz.cpp \ rt/rust_abi.cpp \ diff --git a/src/rt/rust_exchange_alloc.cpp b/src/rt/rust_exchange_alloc.cpp deleted file mode 100644 index 658d97031ce..00000000000 --- a/src/rt/rust_exchange_alloc.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#include "rust_exchange_alloc.h" -#include "sync/sync.h" -#include -#include -#include -#include - -void * -rust_exchange_alloc::malloc(size_t size) { - void *value = ::malloc(size); - assert(value); - return value; -} - -void * -rust_exchange_alloc::realloc(void *ptr, size_t size) { - void *new_ptr = ::realloc(ptr, size); - assert(new_ptr); - return new_ptr; -} - -void -rust_exchange_alloc::free(void *ptr) { - ::free(ptr); -} diff --git a/src/rt/rust_exchange_alloc.h b/src/rt/rust_exchange_alloc.h deleted file mode 100644 index 9699ef6b5e9..00000000000 --- a/src/rt/rust_exchange_alloc.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#ifndef RUST_EXCHANGE_ALLOC_H -#define RUST_EXCHANGE_ALLOC_H - -#include -#include - -class rust_exchange_alloc { - public: - void *malloc(size_t size); - void *realloc(void *mem, size_t size); - void free(void *mem); -}; - -#endif diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h index 7c531297ccd..acedbe31a6b 100644 --- a/src/rt/rust_util.h +++ b/src/rt/rust_util.h @@ -12,7 +12,6 @@ #define RUST_UTIL_H #include -#include "rust_exchange_alloc.h" #include "rust_type.h" extern struct type_desc str_body_tydesc; @@ -57,16 +56,6 @@ vec_data(rust_vec *v) { return reinterpret_cast(v->data); } -inline void reserve_vec_exact(rust_vec** vpp, - size_t size) { - if (size > (*vpp)->alloc) { - rust_exchange_alloc exchange_alloc; - *vpp = (rust_vec*)exchange_alloc - .realloc(*vpp, size + sizeof(rust_vec)); - (*vpp)->alloc = size; - } -} - typedef rust_vec rust_str; inline size_t get_box_size(size_t body_size, size_t body_align) { From a9d28b2d9d9939b1134d48feb1d83864bae782d5 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:22:48 -0700 Subject: [PATCH 03/11] rt: Remove indexed_list --- src/rt/util/indexed_list.h | 115 ------------------------------------- 1 file changed, 115 deletions(-) delete mode 100644 src/rt/util/indexed_list.h diff --git a/src/rt/util/indexed_list.h b/src/rt/util/indexed_list.h deleted file mode 100644 index 4673e9e27e3..00000000000 --- a/src/rt/util/indexed_list.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#ifndef INDEXED_LIST_H -#define INDEXED_LIST_H - -#include -#include "array_list.h" - -class indexed_list_object { -public: - virtual ~indexed_list_object() {} - int32_t list_index; -}; - -template -class indexed_list_element : public indexed_list_object { -public: - T value; - indexed_list_element(T value) : value(value) { - } -}; - -/** - * An array list of objects that are aware of their position in the list. - * Normally, objects in this list should derive from the base class - * "indexed_list_object" however because of nasty Rust compiler dependencies - * on the layout of runtime objects we cannot always derive from this - * base class, so instead we just enforce the informal protocol that any - * object inserted in this list must define a "int32_t list_index" member. - */ -template class indexed_list { - array_list list; -public: - int32_t append(T *value); - bool pop(T **value); - /** - * Same as pop(), except that it returns NULL if the list is empty. - */ - T* pop_value(); - size_t length() const { - return list.size(); - } - bool is_empty() const { - return list.is_empty(); - } - int32_t remove(T* value); - T * operator[](int32_t index); - const T * operator[](int32_t index) const; - ~indexed_list() {} -}; - -template int32_t -indexed_list::append(T *value) { - value->list_index = list.push(value); - return value->list_index; -} - -/** - * Swap delete the last object in the list with the specified object. - */ -template int32_t -indexed_list::remove(T *value) { - assert (value->list_index >= 0); - assert (value->list_index < (int32_t)list.size()); - int32_t removeIndex = value->list_index; - T *last = 0; - list.pop(&last); - if (last->list_index == removeIndex) { - last->list_index = -1; - return removeIndex; - } else { - value->list_index = -1; - list[removeIndex] = last; - last->list_index = removeIndex; - return removeIndex; - } -} - -template bool -indexed_list::pop(T **value) { - return list.pop(value); -} - -template T* -indexed_list::pop_value() { - T *value = NULL; - if (list.pop(&value)) { - return value; - } - return NULL; -} - -template T * -indexed_list::operator[](int32_t index) { - T *value = list[index]; - assert(value->list_index == index); - return value; -} - -template const T * -indexed_list::operator[](int32_t index) const { - T *value = list[index]; - assert(value->list_index == index); - return value; -} - -#endif /* INDEXED_LIST_H */ From 0a1baef4f57b4ac8558a65b7bd8dc787ebf54840 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:29:04 -0700 Subject: [PATCH 04/11] rt: Remove timer --- mk/rt.mk | 1 - src/rt/rust_builtin.cpp | 29 ++++++++++-- src/rt/rust_test_helpers.cpp | 1 - src/rt/sync/timer.cpp | 85 ------------------------------------ src/rt/sync/timer.h | 37 ---------------- 5 files changed, 26 insertions(+), 127 deletions(-) delete mode 100644 src/rt/sync/timer.cpp delete mode 100644 src/rt/sync/timer.h diff --git a/mk/rt.mk b/mk/rt.mk index 14bdbe6445c..e249c8cc657 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -63,7 +63,6 @@ endif endif RUNTIME_CXXS_$(1)_$(2) := \ - rt/sync/timer.cpp \ rt/sync/lock_and_signal.cpp \ rt/sync/rust_thread.cpp \ rt/rust_builtin.cpp \ diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index d7cb0296a17..cb81c149770 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -11,7 +11,6 @@ /* Foreign builtins. */ #include "rust_util.h" -#include "sync/timer.h" #include "sync/rust_thread.h" #include "sync/lock_and_signal.h" #include "memory_region.h" @@ -25,6 +24,7 @@ #ifdef __APPLE__ #include +#include #endif #if !defined(__WIN32__) @@ -242,10 +242,33 @@ get_time(int64_t *sec, int32_t *nsec) { } #endif +const uint64_t ns_per_s = 1000000000LL; + extern "C" CDECL void precise_time_ns(uint64_t *ns) { - timer t; - *ns = t.time_ns(); + +#ifdef __APPLE__ + uint64_t time = mach_absolute_time(); + mach_timebase_info_data_t info = {0, 0}; + if (info.denom == 0) { + mach_timebase_info(&info); + } + uint64_t time_nano = time * (info.numer / info.denom); + *ns = time_nano; +#elif __WIN32__ + uint64_t ticks_per_s; + QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_s); + if (ticks_per_s == 0LL) { + ticks_per_s = 1LL; + } + uint64_t ticks; + QueryPerformanceCounter((LARGE_INTEGER *)&ticks); + *ns = ((ticks * ns_per_s) / ticks_per_s); +#else + timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + *ns = (ts.tv_sec * ns_per_s + ts.tv_nsec); +#endif } struct rust_tm { diff --git a/src/rt/rust_test_helpers.cpp b/src/rt/rust_test_helpers.cpp index b0aab9672ea..b9be4f1e251 100644 --- a/src/rt/rust_test_helpers.cpp +++ b/src/rt/rust_test_helpers.cpp @@ -11,7 +11,6 @@ // Helper functions used only in tests #include "rust_util.h" -#include "sync/timer.h" #include "sync/rust_thread.h" #include "sync/lock_and_signal.h" #include "rust_abi.h" diff --git a/src/rt/sync/timer.cpp b/src/rt/sync/timer.cpp deleted file mode 100644 index 99e5b107dc9..00000000000 --- a/src/rt/sync/timer.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#include "../rust_globals.h" -#include "timer.h" - -#if defined(__APPLE__) -#include -#endif - -uint64_t ns_per_s = 1000000000LL; - -timer::timer() { -#if __WIN32__ - _ticks_per_s = 0LL; - // FIXME (#2675): assert this works or have a workaround. - QueryPerformanceFrequency((LARGE_INTEGER *)&_ticks_per_s); - if (_ticks_per_s == 0LL) { - _ticks_per_s = 1LL; - } -#endif - reset_us(0); -} - -void -timer::reset_us(uint64_t timeout_us) { - _start_us = time_us(); - _timeout_us = timeout_us; -} - -uint64_t -timer::elapsed_us() { - return time_us() - _start_us; -} - -double -timer::elapsed_ms() { - return (double) elapsed_us() / 1000.0; -} - -int64_t -timer::remaining_us() { - return _timeout_us - elapsed_us(); -} - -bool -timer::has_timed_out() { - return remaining_us() <= 0; -} - -uint64_t -timer::time_ns() { -#ifdef __APPLE__ - uint64_t time = mach_absolute_time(); - mach_timebase_info_data_t info = {0, 0}; - if (info.denom == 0) { - mach_timebase_info(&info); - } - uint64_t time_nano = time * (info.numer / info.denom); - return time_nano; -#elif __WIN32__ - uint64_t ticks; - QueryPerformanceCounter((LARGE_INTEGER *)&ticks); - return ((ticks * ns_per_s) / _ticks_per_s); -#else - timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (ts.tv_sec * ns_per_s + ts.tv_nsec); -#endif -} - -uint64_t -timer::time_us() { - return time_ns() / 1000; -} - -timer::~timer() { -} diff --git a/src/rt/sync/timer.h b/src/rt/sync/timer.h deleted file mode 100644 index 59d05878b50..00000000000 --- a/src/rt/sync/timer.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -/* - * Utility class to measure time in a platform independent way. - */ - -#ifndef TIMER_H -#define TIMER_H - -class timer { -private: - uint64_t _start_us; - uint64_t _timeout_us; - uint64_t time_us(); -#if __WIN32__ - uint64_t _ticks_per_s; -#endif -public: - timer(); - void reset_us(uint64_t timeout); - uint64_t elapsed_us(); - double elapsed_ms(); - int64_t remaining_us(); - bool has_timed_out(); - uint64_t time_ns(); - virtual ~timer(); -}; - -#endif /* TIMER_H */ From e3419f9c45476f27e1c89edff5ab557039cdd384 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:42:36 -0700 Subject: [PATCH 05/11] rt: Memory regions are never synchronized now --- src/libstd/rt/local_heap.rs | 7 ++----- src/rt/memory_region.cpp | 24 +++++------------------- src/rt/memory_region.h | 4 +--- src/rt/rust_builtin.cpp | 6 ++---- 4 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/libstd/rt/local_heap.rs b/src/libstd/rt/local_heap.rs index bca1b4a70f4..aa8c5dd4674 100644 --- a/src/libstd/rt/local_heap.rs +++ b/src/libstd/rt/local_heap.rs @@ -40,12 +40,10 @@ impl LocalHeap { #[fixed_stack_segment] #[inline(never)] pub fn new() -> LocalHeap { unsafe { - // Don't need synchronization for the single-threaded local heap - let synchronized = false as uintptr_t; // XXX: These usually come from the environment let detailed_leaks = false as uintptr_t; let poison_on_free = false as uintptr_t; - let region = rust_new_memory_region(synchronized, detailed_leaks, poison_on_free); + let region = rust_new_memory_region(detailed_leaks, poison_on_free); assert!(region.is_not_null()); let boxed = rust_new_boxed_region(region, poison_on_free); assert!(boxed.is_not_null()); @@ -109,8 +107,7 @@ pub fn live_allocs() -> *raw::Box<()> { extern { #[fast_ffi] - fn rust_new_memory_region(synchronized: uintptr_t, - detailed_leaks: uintptr_t, + fn rust_new_memory_region(detailed_leaks: uintptr_t, poison_on_free: uintptr_t) -> *MemoryRegion; #[fast_ffi] fn rust_delete_memory_region(region: *MemoryRegion); diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp index 0d58d4dae92..e75df3db074 100644 --- a/src/rt/memory_region.cpp +++ b/src/rt/memory_region.cpp @@ -42,30 +42,25 @@ inline void memory_region::maybe_print_backtrace(const alloc_header *header) con # endif } -memory_region::memory_region(bool synchronized, - bool detailed_leaks, +memory_region::memory_region(bool detailed_leaks, bool poison_on_free) : _parent(NULL), _live_allocations(0), _detailed_leaks(detailed_leaks), - _poison_on_free(poison_on_free), - _synchronized(synchronized) { + _poison_on_free(poison_on_free) { } memory_region::memory_region(memory_region *parent) : _parent(parent), _live_allocations(0), _detailed_leaks(parent->_detailed_leaks), - _poison_on_free(parent->_poison_on_free), - _synchronized(parent->_synchronized) { + _poison_on_free(parent->_poison_on_free) { } void memory_region::add_alloc() { - //_live_allocations++; - sync::increment(_live_allocations); + _live_allocations++; } void memory_region::dec_alloc() { - //_live_allocations--; - sync::decrement(_live_allocations); + _live_allocations--; } void memory_region::free(void *mem) { @@ -112,7 +107,6 @@ memory_region::realloc(void *mem, size_t orig_size) { # endif # if RUSTRT_TRACK_ALLOCATIONS >= 2 - if (_synchronized) { _lock.lock(); } if (_allocation_list[newMem->index] != alloc) { printf("at index %d, found %p, expected %p\n", alloc->index, _allocation_list[alloc->index], alloc); @@ -125,7 +119,6 @@ memory_region::realloc(void *mem, size_t orig_size) { // printf("realloc: stored %p at index %d, replacing %p\n", // newMem, index, mem); } - if (_synchronized) { _lock.unlock(); } # endif return get_data(newMem); @@ -160,9 +153,7 @@ memory_region::malloc(size_t size, const char *tag) { } memory_region::~memory_region() { - if (_synchronized) { _lock.lock(); } if (_live_allocations == 0 && !_detailed_leaks) { - if (_synchronized) { _lock.unlock(); } return; } char msg[128]; @@ -193,7 +184,6 @@ memory_region::~memory_region() { fprintf(stderr, "%s\n", msg); assert(false); } - if (_synchronized) { _lock.unlock(); } } void @@ -204,7 +194,6 @@ memory_region::release_alloc(void *mem) { # endif # if RUSTRT_TRACK_ALLOCATIONS >= 2 - if (_synchronized) { _lock.lock(); } if (((size_t) alloc->index) >= _allocation_list.size()) { printf("free: ptr 0x%" PRIxPTR " (%s) index %d is beyond allocation_list of size %zu\n", (uintptr_t) get_data(alloc), alloc->tag, alloc->index, _allocation_list.size()); @@ -222,7 +211,6 @@ memory_region::release_alloc(void *mem) { _allocation_list[alloc->index] = NULL; alloc->index = -1; } - if (_synchronized) { _lock.unlock(); } # endif dec_alloc(); @@ -236,9 +224,7 @@ memory_region::claim_alloc(void *mem) { # endif # if RUSTRT_TRACK_ALLOCATIONS >= 2 - if (_synchronized) { _lock.lock(); } alloc->index = _allocation_list.append(alloc); - if (_synchronized) { _lock.unlock(); } # endif # if RUSTRT_TRACK_ALLOCATIONS >= 3 diff --git a/src/rt/memory_region.h b/src/rt/memory_region.h index b833b90d42a..ace463ede21 100644 --- a/src/rt/memory_region.h +++ b/src/rt/memory_region.h @@ -59,7 +59,6 @@ private: array_list _allocation_list; const bool _detailed_leaks; const bool _poison_on_free; - const bool _synchronized; lock_and_signal _lock; void add_alloc(); @@ -77,8 +76,7 @@ private: memory_region& operator=(const memory_region& rhs); public: - memory_region(bool synchronized, - bool detailed_leaks, bool poison_on_free); + memory_region(bool detailed_leaks, bool poison_on_free); memory_region(memory_region *parent); void *malloc(size_t size, const char *tag); void *realloc(void *mem, size_t size); diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index cb81c149770..784693755c5 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -528,11 +528,9 @@ rust_initialize_rt_tls_key() { } extern "C" CDECL memory_region* -rust_new_memory_region(uintptr_t synchronized, - uintptr_t detailed_leaks, +rust_new_memory_region(uintptr_t detailed_leaks, uintptr_t poison_on_free) { - return new memory_region((bool)synchronized, - (bool)detailed_leaks, + return new memory_region((bool)detailed_leaks, (bool)poison_on_free); } From b4ef59db2fdf3d2f2c239a03f60569196a8df44d Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:44:01 -0700 Subject: [PATCH 06/11] rt: Remove sync.h --- src/rt/memory_region.cpp | 1 - src/rt/sync/sync.h | 53 ---------------------------------------- 2 files changed, 54 deletions(-) delete mode 100644 src/rt/sync/sync.h diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp index e75df3db074..4a34312c6d4 100644 --- a/src/rt/memory_region.cpp +++ b/src/rt/memory_region.cpp @@ -9,7 +9,6 @@ // except according to those terms. -#include "sync/sync.h" #include "memory_region.h" #if RUSTRT_TRACK_ALLOCATIONS >= 3 diff --git a/src/rt/sync/sync.h b/src/rt/sync/sync.h deleted file mode 100644 index 6ac97d57933..00000000000 --- a/src/rt/sync/sync.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#ifndef SYNC_H -#define SYNC_H - -class sync { -public: - template - static bool compare_and_swap(T *address, - T oldValue, T newValue) { - return __sync_bool_compare_and_swap(address, oldValue, newValue); - } - - template - static T increment(T *address) { - return __sync_add_and_fetch(address, 1); - } - - template - static T decrement(T *address) { - return __sync_sub_and_fetch(address, 1); - } - - template - static T increment(T &address) { - return __sync_add_and_fetch(&address, 1); - } - - template - static T decrement(T &address) { - return __sync_sub_and_fetch(&address, 1); - } - - template - static T read(T *address) { - return __sync_add_and_fetch(address, 0); - } - - template - static T read(T &address) { - return __sync_add_and_fetch(&address, 0); - } -}; - -#endif /* SYNC_H */ From 4541c6cfe3ee875020329f888c39ea75183b23d1 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:55:11 -0700 Subject: [PATCH 07/11] rt: Remove exit_status helpers --- src/libstd/rt/util.rs | 21 +++++---------------- src/rt/rust_builtin.cpp | 15 --------------- src/rt/rustrt.def.in | 2 -- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index 1f29830aa04..f2ede8872c2 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -14,6 +14,7 @@ use libc; use option::{Some, None}; use os; use str::StrSlice; +use unstable::atomics::{AtomicInt, INIT_ATOMIC_INT, SeqCst}; #[cfg(target_os="macos")] use unstable::running_on_valgrind; @@ -129,24 +130,12 @@ memory and partly incapable of presentation to others.", } } -pub fn set_exit_status(code: int) { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { - return rust_set_exit_status_newrt(code as libc::uintptr_t); - } +static mut EXIT_STATUS: AtomicInt = INIT_ATOMIC_INT; - extern { - fn rust_set_exit_status_newrt(code: libc::uintptr_t); - } +pub fn set_exit_status(code: int) { + unsafe { EXIT_STATUS.store(code, SeqCst) } } pub fn get_exit_status() -> int { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { - return rust_get_exit_status_newrt() as int; - } - - extern { - fn rust_get_exit_status_newrt() -> libc::uintptr_t; - } + unsafe { EXIT_STATUS.load(SeqCst) } } diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 784693755c5..3a2a8e89415 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -653,21 +653,6 @@ rust_get_global_args_ptr() { return &global_args_ptr; } -static lock_and_signal exit_status_lock; -static uintptr_t exit_status = 0; - -extern "C" CDECL void -rust_set_exit_status_newrt(uintptr_t code) { - scoped_lock with(exit_status_lock); - exit_status = code; -} - -extern "C" CDECL uintptr_t -rust_get_exit_status_newrt() { - scoped_lock with(exit_status_lock); - return exit_status; -} - static lock_and_signal change_dir_lock; extern "C" CDECL void diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 5100e732308..54b6dc2c602 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -191,8 +191,6 @@ rust_get_num_cpus rust_get_global_args_ptr rust_take_global_args_lock rust_drop_global_args_lock -rust_set_exit_status_newrt -rust_get_exit_status_newrt rust_take_change_dir_lock rust_drop_change_dir_lock rust_get_test_int From c17447f8b30a11ce6624c7088f647a6261c70135 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 22:57:40 -0700 Subject: [PATCH 08/11] rt: Move some test functions to rust_test_helpers --- src/rt/rust_builtin.cpp | 47 ------------------- src/rt/rust_test_helpers.cpp | 46 ++++++++++++++++++ src/rt/rustrt.def.in | 8 ++-- .../compile-fail/attrs-after-extern-mod.rs | 4 +- src/test/run-pass/static-mut-foreign.rs | 28 +++++------ src/test/run-pass/struct-return.rs | 8 ++-- 6 files changed, 70 insertions(+), 71 deletions(-) diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 3a2a8e89415..ff4975fdcd8 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -99,53 +99,6 @@ rand_free(rust_rng *rng) { free(rng); } - -/* Debug helpers strictly to verify ABI conformance. - * - * FIXME (#2665): move these into a testcase when the testsuite - * understands how to have explicit C files included. - */ - -struct quad { - uint64_t a; - uint64_t b; - uint64_t c; - uint64_t d; -}; - -struct floats { - double a; - uint8_t b; - double c; -}; - -extern "C" quad -debug_abi_1(quad q) { - quad qq = { q.c + 1, - q.d - 1, - q.a + 1, - q.b - 1 }; - return qq; -} - -extern "C" floats -debug_abi_2(floats f) { - floats ff = { f.c + 1.0, - 0xff, - f.a - 1.0 }; - return ff; -} - -extern "C" int -debug_static_mut; - -int debug_static_mut = 3; - -extern "C" void -debug_static_mut_check_four() { - assert(debug_static_mut == 4); -} - extern "C" CDECL char* #if defined(__WIN32__) rust_list_dir_val(WIN32_FIND_DATA* entry_ptr) { diff --git a/src/rt/rust_test_helpers.cpp b/src/rt/rust_test_helpers.cpp index b9be4f1e251..33fea72cca7 100644 --- a/src/rt/rust_test_helpers.cpp +++ b/src/rt/rust_test_helpers.cpp @@ -178,3 +178,49 @@ extern "C" CDECL intptr_t rust_get_test_int() { return 1; } + +/* Debug helpers strictly to verify ABI conformance. + * + * FIXME (#2665): move these into a testcase when the testsuite + * understands how to have explicit C files included. + */ + +struct quad { + uint64_t a; + uint64_t b; + uint64_t c; + uint64_t d; +}; + +struct floats { + double a; + uint8_t b; + double c; +}; + +extern "C" quad +rust_dbg_abi_1(quad q) { + quad qq = { q.c + 1, + q.d - 1, + q.a + 1, + q.b - 1 }; + return qq; +} + +extern "C" floats +rust_dbg_abi_2(floats f) { + floats ff = { f.c + 1.0, + 0xff, + f.a - 1.0 }; + return ff; +} + +extern "C" int +rust_dbg_static_mut; + +int rust_dbg_static_mut = 3; + +extern "C" void +rust_dbg_static_mut_check_four() { + assert(rust_dbg_static_mut == 4); +} diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 54b6dc2c602..f6c15925598 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -1,7 +1,7 @@ -debug_abi_1 -debug_abi_2 -debug_static_mut -debug_static_mut_check_four +rust_dbg_abi_1 +rust_dbg_abi_2 +rust_dbg_static_mut +rust_dbg_static_mut_check_four get_time rust_tzset rust_gmtime diff --git a/src/test/compile-fail/attrs-after-extern-mod.rs b/src/test/compile-fail/attrs-after-extern-mod.rs index 1903786eef8..3102fb2664f 100644 --- a/src/test/compile-fail/attrs-after-extern-mod.rs +++ b/src/test/compile-fail/attrs-after-extern-mod.rs @@ -16,8 +16,8 @@ use std::libc; #[nolink] extern { - static mut debug_static_mut: libc::c_int; - pub fn debug_static_mut_check_four(); + static mut rust_dbg_static_mut: libc::c_int; + pub fn rust_dbg_static_mut_check_four(); #[cfg(stage37)] //~ ERROR expected item after attributes } diff --git a/src/test/run-pass/static-mut-foreign.rs b/src/test/run-pass/static-mut-foreign.rs index 429b49375e0..0d042d002a1 100644 --- a/src/test/run-pass/static-mut-foreign.rs +++ b/src/test/run-pass/static-mut-foreign.rs @@ -16,8 +16,8 @@ use std::libc; #[nolink] extern { - static mut debug_static_mut: libc::c_int; - pub fn debug_static_mut_check_four(); + static mut rust_dbg_static_mut: libc::c_int; + pub fn rust_dbg_static_mut_check_four(); } unsafe fn static_bound(_: &'static libc::c_int) {} @@ -28,18 +28,18 @@ fn static_bound_set(a: &'static mut libc::c_int) { #[fixed_stack_segment] #[inline(never)] unsafe fn run() { - assert!(debug_static_mut == 3); - debug_static_mut = 4; - assert!(debug_static_mut == 4); - debug_static_mut_check_four(); - debug_static_mut += 1; - assert!(debug_static_mut == 5); - debug_static_mut *= 3; - assert!(debug_static_mut == 15); - debug_static_mut = -3; - assert!(debug_static_mut == -3); - static_bound(&debug_static_mut); - static_bound_set(&mut debug_static_mut); + assert!(rust_dbg_static_mut == 3); + rust_dbg_static_mut = 4; + assert!(rust_dbg_static_mut == 4); + rust_dbg_static_mut_check_four(); + rust_dbg_static_mut += 1; + assert!(rust_dbg_static_mut == 5); + rust_dbg_static_mut *= 3; + assert!(rust_dbg_static_mut == 15); + rust_dbg_static_mut = -3; + assert!(rust_dbg_static_mut == -3); + static_bound(&rust_dbg_static_mut); + static_bound_set(&mut rust_dbg_static_mut); } pub fn main() { diff --git a/src/test/run-pass/struct-return.rs b/src/test/run-pass/struct-return.rs index 1c39504ba71..3f63902eb31 100644 --- a/src/test/run-pass/struct-return.rs +++ b/src/test/run-pass/struct-return.rs @@ -16,8 +16,8 @@ mod rustrt { #[nolink] extern { - pub fn debug_abi_1(q: Quad) -> Quad; - pub fn debug_abi_2(f: Floats) -> Floats; + pub fn rust_dbg_abi_1(q: Quad) -> Quad; + pub fn rust_dbg_abi_2(f: Floats) -> Floats; } } @@ -28,7 +28,7 @@ fn test1() { b: 0xbbbb_bbbb_bbbb_bbbb_u64, c: 0xcccc_cccc_cccc_cccc_u64, d: 0xdddd_dddd_dddd_dddd_u64 }; - let qq = rustrt::debug_abi_1(q); + let qq = rustrt::rust_dbg_abi_1(q); error!("a: %x", qq.a as uint); error!("b: %x", qq.b as uint); error!("c: %x", qq.c as uint); @@ -48,7 +48,7 @@ fn test2() { let f = Floats { a: 1.234567890e-15_f64, b: 0b_1010_1010_u8, c: 1.0987654321e-15_f64 }; - let ff = rustrt::debug_abi_2(f); + let ff = rustrt::rust_dbg_abi_2(f); error!("a: %f", ff.a as float); error!("b: %u", ff.b as uint); error!("c: %f", ff.c as float); From b72c43739d37b9a495bdbd64852198ba1f7f0807 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 23:23:51 -0700 Subject: [PATCH 09/11] rt: Remove old precise GC code --- mk/rt.mk | 1 - src/libstd/rt/mod.rs | 3 -- src/rt/rust_gc_metadata.cpp | 95 ------------------------------------- src/rt/rust_gc_metadata.h | 26 ---------- src/rt/rustrt.def.in | 2 - 5 files changed, 127 deletions(-) delete mode 100644 src/rt/rust_gc_metadata.cpp delete mode 100644 src/rt/rust_gc_metadata.h diff --git a/mk/rt.mk b/mk/rt.mk index e249c8cc657..915848e6abd 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -71,7 +71,6 @@ RUNTIME_CXXS_$(1)_$(2) := \ rt/rust_upcall.cpp \ rt/rust_uv.cpp \ rt/rust_crate_map.cpp \ - rt/rust_gc_metadata.cpp \ rt/rust_util.cpp \ rt/rust_log.cpp \ rt/isaac/randport.cpp \ diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 8b3e65b57ab..ead0fb63793 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -224,10 +224,7 @@ pub fn init(argc: int, argv: **u8, crate_map: *u8) { args::init(argc, argv); env::init(); logging::init(crate_map); - rust_update_gc_metadata(crate_map); } - - externfn!(fn rust_update_gc_metadata(crate_map: *u8)); } /// One-time runtime cleanup. diff --git a/src/rt/rust_gc_metadata.cpp b/src/rt/rust_gc_metadata.cpp deleted file mode 100644 index e37856255a7..00000000000 --- a/src/rt/rust_gc_metadata.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#include "rust_gc_metadata.h" -#include "rust_crate_map.h" -#include "rust_globals.h" - -#include -#include - -struct safe_point { - uintptr_t safe_point_loc; - uintptr_t safe_point_meta; - uintptr_t function_meta; -}; - -struct update_gc_entry_args { - std::vector *safe_points; -}; - -static void -update_gc_entry(const mod_entry *entry, void *cookie) { - update_gc_entry_args *args = (update_gc_entry_args *)cookie; - if (!strcmp(entry->name, "_gc_module_metadata")) { - uintptr_t *next = (uintptr_t *)entry->state; - uint32_t num_safe_points = *(uint32_t *)next; - next++; - - for (uint32_t i = 0; i < num_safe_points; i++) { - safe_point sp = { next[0], next[1], next[2] }; - next += 3; - - args->safe_points->push_back(sp); - } - } -} - -static bool -cmp_safe_point(safe_point a, safe_point b) { - return a.safe_point_loc < b.safe_point_loc; -} - -uintptr_t *global_safe_points = 0; - -void -update_gc_metadata(const void* map) { - std::vector safe_points; - update_gc_entry_args args = { &safe_points }; - - // Extract list of safe points from each module. - iter_crate_map((const cratemap *)map, update_gc_entry, (void *)&args); - std::sort(safe_points.begin(), safe_points.end(), cmp_safe_point); - - // Serialize safe point list into format expected by runtime. - global_safe_points = - (uintptr_t *)malloc((safe_points.size()*3 + 1)*sizeof(uintptr_t)); - if (!global_safe_points) return; - - uintptr_t *next = global_safe_points; - *next = safe_points.size(); - next++; - for (uint32_t i = 0; i < safe_points.size(); i++) { - next[0] = safe_points[i].safe_point_loc; - next[1] = safe_points[i].safe_point_meta; - next[2] = safe_points[i].function_meta; - next += 3; - } -} - -extern "C" CDECL void * -rust_gc_metadata() { - return (void *)global_safe_points; -} - -extern "C" CDECL void -rust_update_gc_metadata(const void* map) { - update_gc_metadata(map); -} - -// -// Local Variables: -// mode: C++ -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// End: -// diff --git a/src/rt/rust_gc_metadata.h b/src/rt/rust_gc_metadata.h deleted file mode 100644 index d8d98e75b93..00000000000 --- a/src/rt/rust_gc_metadata.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#ifndef RUST_GC_METADATA_H -#define RUST_GC_METADATA_H - -void update_gc_metadata(const void* map); - -// -// Local Variables: -// mode: C++ -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// End: -// - -#endif /* RUST_GC_METADATA_H */ diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index f6c15925598..6e95d96012b 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -130,8 +130,6 @@ rust_lock_little_lock rust_unlock_little_lock tdefl_compress_mem_to_heap tinfl_decompress_mem_to_heap -rust_gc_metadata -rust_update_gc_metadata rust_uv_ip4_port rust_uv_ip6_port rust_uv_tcp_getpeername From 0ee24437ce80bf25023ddb45db37fa3eadc689f1 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 23:26:37 -0700 Subject: [PATCH 10/11] rt: Remove rust_util.cpp --- mk/rt.mk | 1 - src/rt/rust_util.cpp | 35 ----------------------------------- src/rt/rust_util.h | 2 -- 3 files changed, 38 deletions(-) delete mode 100644 src/rt/rust_util.cpp diff --git a/mk/rt.mk b/mk/rt.mk index 915848e6abd..f4b0132ded8 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -71,7 +71,6 @@ RUNTIME_CXXS_$(1)_$(2) := \ rt/rust_upcall.cpp \ rt/rust_uv.cpp \ rt/rust_crate_map.cpp \ - rt/rust_util.cpp \ rt/rust_log.cpp \ rt/isaac/randport.cpp \ rt/miniz.cpp \ diff --git a/src/rt/rust_util.cpp b/src/rt/rust_util.cpp deleted file mode 100644 index 28c69af427a..00000000000 --- a/src/rt/rust_util.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#include "rust_type.h" - - -// A hardcoded type descriptor for strings, since the runtime needs to -// be able to create them. - -struct type_desc str_body_tydesc = { - 1, // size - 1, // align - NULL, // take_glue - NULL, // drop_glue - NULL, // free_glue - NULL, // visit_glue - 0, // borrow_offset -}; - -// -// Local Variables: -// mode: C++ -// fill-column: 78; -// indent-tabs-mode: nil -// c-basic-offset: 4 -// buffer-file-coding-system: utf-8-unix -// End: -// diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h index acedbe31a6b..d78ade4e94c 100644 --- a/src/rt/rust_util.h +++ b/src/rt/rust_util.h @@ -14,8 +14,6 @@ #include #include "rust_type.h" -extern struct type_desc str_body_tydesc; - // Inline fn used regularly elsewhere. // Rounds |size| to the nearest |alignment|. Invariant: |alignment| is a power From 9cdfe1e6039598961838ba2cc88a6ed6aa5449bf Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Aug 2013 23:30:25 -0700 Subject: [PATCH 11/11] rt: Remove rust_abi --- mk/rt.mk | 1 - src/rt/rust_abi.cpp | 88 ------------------------------------ src/rt/rust_abi.h | 78 -------------------------------- src/rt/rust_builtin.cpp | 1 - src/rt/rust_test_helpers.cpp | 1 - 5 files changed, 169 deletions(-) delete mode 100644 src/rt/rust_abi.cpp delete mode 100644 src/rt/rust_abi.h diff --git a/mk/rt.mk b/mk/rt.mk index f4b0132ded8..6a9620c7364 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -74,7 +74,6 @@ RUNTIME_CXXS_$(1)_$(2) := \ rt/rust_log.cpp \ rt/isaac/randport.cpp \ rt/miniz.cpp \ - rt/rust_abi.cpp \ rt/memory_region.cpp \ rt/boxed_region.cpp \ rt/arch/$$(HOST_$(1))/context.cpp \ diff --git a/src/rt/rust_abi.cpp b/src/rt/rust_abi.cpp deleted file mode 100644 index fd1b7860b29..00000000000 --- a/src/rt/rust_abi.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ABI-specific routines. - -#include -#include -#include -#include -#include -#include "rust_abi.h" - -#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) -#define HAVE_DLFCN_H -#include -#elif defined(_WIN32) -// Otherwise it's windows.h -- included in rust_abi.h -#endif - -#define END_OF_STACK_RA (void (*)())0xdeadbeef - -weak_symbol abi_version("rust_abi_version"); - -uint32_t get_abi_version() { - return (*abi_version == NULL) ? 0 : **abi_version; -} - -namespace stack_walk { - -#ifdef HAVE_DLFCN_H -std::string -frame::symbol() const { - std::stringstream ss; - - Dl_info info; - if (!dladdr((void *)ra, &info)) - ss << "??"; - else - ss << info.dli_sname; - - ss << " @ " << std::hex << (uintptr_t)ra; - return ss.str(); -} -#else -std::string -frame::symbol() const { - std::stringstream ss; - ss << std::hex << (uintptr_t)ra; - return ss.str(); -} -#endif - -std::vector -backtrace() { - std::vector frames; - - // Ideally we would use the current value of EIP here, but there's no - // portable way to get that and there are never any GC roots in our C++ - // frames anyhow. - frame f(__builtin_frame_address(0), (void (*)())NULL); - - while (f.ra != END_OF_STACK_RA) { - frames.push_back(f); - f.next(); - } - return frames; -} - -std::string -symbolicate(const std::vector &frames) { - std::stringstream ss; - std::vector::const_iterator begin(frames.begin()), - end(frames.end()); - while (begin != end) { - ss << begin->symbol() << std::endl; - ++begin; - } - return ss.str(); -} - -} // end namespace stack_walk diff --git a/src/rt/rust_abi.h b/src/rt/rust_abi.h deleted file mode 100644 index 4179bf75157..00000000000 --- a/src/rt/rust_abi.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// ABI-specific routines. - -#ifndef RUST_ABI_H -#define RUST_ABI_H - -#include -#include -#include -#include - -#ifdef __WIN32__ -#include -#else -#include -#endif - -template -class weak_symbol { -private: - bool init; - T *data; - const char *name; - - void fill() { - if (init) - return; - -#ifdef __WIN32__ - data = (T *)GetProcAddress(GetModuleHandle(NULL), name); -#else - data = (T *)dlsym(RTLD_DEFAULT, name); -#endif - - init = true; - } - -public: - weak_symbol(const char *in_name) - : init(false), data(NULL), name(in_name) {} - - T *&operator*() { fill(); return data; } -}; - -namespace stack_walk { - -struct frame { - uint8_t *bp; // The frame pointer. - void (*ra)(); // The return address. - - frame(void *in_bp, void (*in_ra)()) : bp((uint8_t *)in_bp), ra(in_ra) {} - - inline void next() { - ra = *(void (**)())(bp + sizeof(void *)); - bp = *(uint8_t **)bp; - } - - std::string symbol() const; -}; - -std::vector backtrace(); -std::string symbolicate(const std::vector &frames); - -} // end namespace stack_walk - - -uint32_t get_abi_version(); - -#endif diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index ff4975fdcd8..6f3a3bd3686 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -15,7 +15,6 @@ #include "sync/lock_and_signal.h" #include "memory_region.h" #include "boxed_region.h" -#include "rust_abi.h" #include "rust_rng.h" #include "vg/valgrind.h" #include "sp.h" diff --git a/src/rt/rust_test_helpers.cpp b/src/rt/rust_test_helpers.cpp index 33fea72cca7..f10a1f36938 100644 --- a/src/rt/rust_test_helpers.cpp +++ b/src/rt/rust_test_helpers.cpp @@ -13,7 +13,6 @@ #include "rust_util.h" #include "sync/rust_thread.h" #include "sync/lock_and_signal.h" -#include "rust_abi.h" // These functions are used in the unit tests for C ABI calls.