about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
AgeCommit message (Collapse)AuthorLines
2013-11-18Move runtime files to C instead of C++Alex Crichton-598/+0
Explicitly have the only C++ portion of the runtime be one file with exception handling. All other runtime files must now live in C and be fully defined in C.
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-106/+1
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-18Implement a native mutex typeAlex Crichton-0/+21
This mutex is built on top of pthreads for unix and the related windows apis on windows. This is a straight port of the lock_and_signal type from C++ to rust. Almost all operations on the type are unsafe, and it's definitely not recommended for general use. Closes #9105
2013-11-18rt: Namespace all C functions under rust_Brian Anderson-3/+3
2013-11-13add rust_trylock_little_lockJason Toffaletti-0/+5
Try to acquire lock and succeed only if lock is not already held. Uses TryEnterCriticalSection or pthread_mutex_trylock.
2013-11-12rt: Delete more C++Brian Anderson-1/+10
2013-11-11Add asserts to check for faililng QueryPerformance* calls in precise_time_nsBirunthan Mohanathas-7/+9
Closes #2675.
2013-11-11Change use of unsigned integers to signed integers for clarity inBirunthan Mohanathas-5/+5
precise_time_ns The QueryPerformance* functions take a LARGE_INTEGER, which is a signed 64-bit integer rather than an unsigned 64-bit integer. `ts.tv_sec`, too, is a signed integer so `ns_per_s` has been changed to a int64_t.
2013-11-08auto merge of #10348 : ksh8281/rust/fix_android_timegm, r=yichoibors-2/+5
fix timegm bug on android TZ restore not correctly before. and it cause test case fail (time::tests::run_tests::test_convertions) with @sammykim
2013-11-08fix android timegmsh8281.kim-2/+5
2013-11-07auto merge of #10281 : klutzy/rust/rt-timezone, r=alexcrichtonbors-4/+9
Previously #9418 fixed utf-8 assertion issue by wcsftime, but the function didn't work as expected: it follows the locale set by setlocale(), not the system code page. This patch fixes it by manual multibyte-to-unicode conversion.
2013-11-06auto merge of #10227 : kud1ing/rust/ios, r=alexcrichtonbors-3/+9
2013-11-06Fixes for compilation to iOS:kud1ing-3/+9
- remove /usr/include from the include path since the iOS SDK provides the correct version - `_NSGetEnviron()` is private and not available on iOS - `.align` without an argument is not allowed with the Apple tools. 2^2 should be the default alignment - ignore error messages for XCode < 5 - pass include path to libuv
2013-11-05Move implementation for threads to RustDirkjan Bussink-37/+0
This binds to the appropriate pthreads_* and Windows specific functions and calls them from Rust. This allows for removal of the C++ support code for threads. Fixes #10162
2013-11-05rt: Convert timezone to utf-8 on Windowsklutzy-4/+9
Previously #9418 fixed utf-8 assertion issue by wcsftime, but the function didn't work as expected: it follows the locale set by setlocale(), not the system code page. This patch fixes it by manual multibyte-to-unicode conversion.
2013-10-26Rewrite boxed_region/memory_region in RustAlex Crichton-40/+0
This drops more of the old C++ runtime to rather be written in rust. A few features were lost along the way, but hopefully not too many. The main loss is that there are no longer backtraces associated with allocations (rust doesn't have a way of acquiring those just yet). Other than that though, I believe that the rest of the debugging utilities made their way over into rust. Closes #8704
2013-10-24Implement a basic event loop built on LittleLockAlex Crichton-0/+10
It's not guaranteed that there will always be an event loop to run, and this implementation will serve as an incredibly basic one which does not provide any I/O, but allows the scheduler to still run. cc #9128
2013-10-23std::rand: documentation & references.Huon Wilson-0/+2
Most importantly, links to the papers/references for the core algorithms (the RNG ones & the distribution ones).
2013-10-20auto merge of #9812 : HNO3/rust/windows-utf8, r=alexcrichtonbors-4/+42
This fixes #9418 and #9618, and potential problems related to directory walking.
2013-10-20Fix unicode errors on Windows in path_is_dir, path_exists, getcwd and ↵LEE Wondong-4/+42
rust_localtime. This make these functions use wchar_t version of APIs, instead of char version.
2013-10-19Use __morestack to detect stack overflowAlex Crichton-14/+11
This commit resumes management of the stack boundaries and limits when switching between tasks. This additionally leverages the __morestack function to run code on "stack overflow". The current behavior is to abort the process, but this is probably not the best behavior in the long term (for deails, see the comment I wrote up in the stack exhaustion routine).
2013-10-16drop the linenoise libraryDaniel Micay-12/+0
Closes #5038
2013-10-09auto merge of #9664 : alexcrichton/rust/logging, r=huonwbors-21/+0
This makes some headway on #3309, see commits for details.
2013-10-09std::rand: make the windows OSRng more correct, remove some C++.Huon Wilson-6/+56
This lets the C++ code in the rt handle the (slightly) tricky parts of random number generation: e.g. error detection/handling, and using the values of the `#define`d options to the various functions.
2013-10-05Fix thread safety issues in dynamic_libSteven Fackler-0/+12
The root issue is that dlerror isn't reentrant or even thread safe. The Windows code isn't affected since errno is thread-local on Windows and it's running in an atomically block to ensure there isn't a green thread context switch. Closes #8156
2013-10-03Document logging and remove old functionsAlex Crichton-21/+0
This adds a large doc-block to the top of the std::logging module explaining how to use it. This is mostly just making sure that all the information in the manual's section about logging is also here (in case someone decides to look into this module first). This also removes the old console_{on,off} methods. As far as I can tell, the functions were only used by the compiler, and there's no reason for them to be used because they're all turned off by default anyway (maybe they were turned on by default at some point...) I believe that this is the final nail in the coffin and closes #5021
2013-09-23Remove the C(++) ISAAC Rng from the old rt.Huon Wilson-24/+0
This has to leave rust_gen_seed and rng_gen_seed around since they're used to initialise the std::rand RNGs.
2013-09-18Remove rust_run_program.cppAlex Crichton-0/+23
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674
2013-09-13Remove all usage of change_dir_lockedAlex Crichton-12/+0
While usage of change_dir_locked is synchronized against itself, it's not synchronized against other relative path usage, so I'm of the opinion that it just really doesn't help in running tests. In order to prevent the problems that have been cropping up, this completely removes the function. All existing tests (except one) using it have been moved to run-pass tests where they get their own process and don't need to be synchronized with anyone else. There is one now-ignored rustpkg test because when I moved it to a run-pass test apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having linkage failures).
2013-09-11extra: use a mutex to wrap linenoise calls and make them threadsafe.Huon Wilson-0/+12
Fixes #3921.
2013-09-01Fix incorrect strftime error handling in rust_localtimeBirunthan Mohanathas-3/+6
Closes #8702.
2013-08-24std: Convert the runtime TLS key to a Rust global to avoid FFIBrian Anderson-11/+6
2013-08-23rt: Remove rust_abiBrian Anderson-1/+0
2013-08-23rt: Move some test functions to rust_test_helpersBrian Anderson-47/+0
2013-08-23rt: Remove exit_status helpersBrian Anderson-15/+0
2013-08-23rt: Memory regions are never synchronized nowBrian Anderson-4/+2
2013-08-23rt: Remove timerBrian Anderson-3/+26
2013-08-23rt: Remove last use of C++ exchange allocBrian Anderson-1/+1
2013-08-22Un-disable stack unwinding on Windows.Vadim Chugunov-4/+0
2013-08-16rt: Remove rust_stackBrian Anderson-0/+10
2013-08-16rt: Remove rust_envBrian Anderson-1/+53
2013-08-09auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=ericktbors-3/+2
This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects: * No interior nulls * Ends with a trailing null
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-237/+19
2013-08-04Remove trailing null from stringsErick Tryzelaar-3/+2
2013-07-31extra: Remove dbg module and rt support codeBrian Anderson-92/+0
This stuff is ancient, unused, and tied to oldsched
2013-07-31auto merge of #8143 : brson/rust/change-dir-lock, r=luqmanabors-2/+2
2013-07-30rt: Use the correct global change_dir lockBrian Anderson-2/+2
2013-07-30std: Remove ManualThreads spawn modeBrian Anderson-12/+0
2013-07-30std::rt: Change Thread interface to require an explicit joinBrian Anderson-1/+6
Makes it more obvious what's going on
2013-07-22std: Remove at_exit API. UnusedBrian Anderson-6/+0