Alex Crichton
2cd9d7bc88
Expand ctypes warnings to warn about *int/*uint
...
Also ends up fixing one case in libstd
2013-07-11 19:45:25 -07:00
Brian Anderson
4cd51c416b
rt: Move win32_require out of the rust_kernel type
...
This is only used on rust_rng, which I am trying to extricate from
the kernel.
2013-05-07 12:08:00 -07:00
Daniel Micay
f34dd565d9
rm unused hash table from the runtime
2013-02-15 18:22:34 -05:00
bors
20fd0c53ed
auto merge of #4938 : thestinger/rust/no_zero, r=brson
...
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these.
This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
2013-02-14 18:27:54 -08:00
Daniel Micay
2e0614750c
get rid of unused exchange_alloc calloc method
...
this isn't actually calloc - it calls the malloc wrapper which no
longer zeroes
2013-02-14 18:24:52 -05:00
Zack Corr
ebd20b7944
Rename dec/inc_weak_task_count to inc/dec_live_count and remove register_task/unregister_task. Closes #4768
2013-02-09 19:19:31 +10:00
Brian Anderson
e43c5bdc6b
Rewrite the exchange allocator to work without an active scheduler. #4457
2013-02-06 14:27:36 -08:00
Brian Anderson
4f6516969e
rt: Remove ports
2013-02-01 21:22:49 -08:00
Brian Anderson
1ef83945c1
Merge remote-tracking branch 'brson/nocommupstream'
...
Conflicts:
src/libcore/private.rs
src/libcore/task/mod.rs
src/libcore/task/spawn.rs
src/libstd/net_tcp.rs
src/libstd/uv_global_loop.rs
src/libstd/uv_iotask.rs
2013-01-25 18:06:30 -08:00
Brian Anderson
cc9ab2c033
Remove old comm-based weak task interface
2013-01-23 17:35:34 -08:00
Brian Anderson
b9608fe423
std: Convert uv_global_loop to use pipes
2013-01-23 17:35:34 -08:00
Brian Anderson
fb9299346a
core: Convert getenv/setenv to use a mutex
...
This much simpler implementation uses a global mutex
and eliminates the kernel environment channel.
2013-01-23 17:35:34 -08:00
Brian Anderson
8852279a9e
core: Add new weak task API
2013-01-23 17:35:31 -08:00
Brian Anderson
6b6acde972
Add a license check to tidy. #4018
2013-01-17 23:28:42 -08:00
Brian Anderson
db1abbec4c
core: Add private global data interface. #3915
2013-01-17 19:24:50 -08:00
Brian Anderson
ac435af73a
Add at_exit function #4450
2013-01-15 18:00:19 -08:00
Brian Anderson
090b247056
Spawn new tasks onto the primary scheduler by default. #3760
2013-01-15 18:00:19 -08:00
Graydon Hoare
12c32e944d
Add license boilerplate to more files.
2012-12-10 17:32:58 -08:00
Ben Blum
5bb4a12900
[1/4 for #2365 , #2671 ] Fix create/kill race with schedulers and tasks during rust_kernel::fail
2012-07-20 19:23:19 -04:00
Michael Sullivan
4c0d41cffa
Add a malloc_dyn upcall for dynamically sized allocations on the shared heap.
2012-06-13 17:59:21 -07:00
Brian Anderson
94ac30c498
rt: Improve docs for main, kernel, scheduler, and task
2012-06-02 23:14:47 -07:00
Brian Anderson
46cc11ea88
core: Serialize all access to the environment using a weak global task
2012-04-30 17:34:29 -07:00
Jeff Olson
577b888e4b
rt: remove unneccesary c++ functions and rust_kernel data, re: global loop
2012-04-27 22:19:30 -07:00
Jeff Olson
253fad7788
replace impl of globa_async_handle with one using atomic compare-and-swap
2012-04-20 15:23:22 -07:00
Jeff Olson
9a5d1974dc
don't use ::malloc for initializing the global_async_handle in rust_kernel
2012-04-20 15:23:22 -07:00
Jeff Olson
12f2f4c15c
rt: whitespace cleanup for existing libuv integration
2012-04-20 15:23:22 -07:00
Jeff Olson
c6667c06c3
add needed fields for global libuv loop + bindings to manage from rust
...
adding two pointers fields to rust_kernel :(
.. have to do manual malloc/free for one of the fields, which feels wrong
2012-04-20 15:23:21 -07:00
Brian Anderson
01dc4a8b26
core: Add priv::weaken_task
2012-04-07 19:56:41 -07:00
Brian Anderson
e325146eb4
Merge remote-tracking branch 'brson/mainthread'
...
Conflicts:
src/rt/rust_kernel.cpp
src/rt/rust_scheduler.cpp
src/rt/rust_scheduler.h
2012-04-03 20:30:01 -07:00
Brian Anderson
4cf7efc8f7
rt: Fix bugs in the osmain scheduler
2012-04-03 20:24:29 -07:00
Brian Anderson
4f4b7b10bb
rt: Futz with headers to satisfy FreeBSD
2012-04-03 16:02:38 -07:00
Jon Morton
72ffb4b446
fix 'I don't know how C works'
2012-04-03 16:02:38 -07:00
Jon Morton
386069f39e
actually remove memory.h; include cleanups
2012-04-03 16:02:38 -07:00
Jon Morton
632a4c9326
Refactor includes structure, getting rid of rust_internal.h
...
Many changes to code structure are included:
- removed TIME_SLICE_IN_MS
- removed sychronized_indexed_list
- removed region_owned
- kernel_owned move to kernel.h, task_owned moved to task.h
- global configs moved to rust_globals.h
- changed #pragma once to standard guard in rust_upcall.h
- got rid of memory.h
2012-04-03 16:02:38 -07:00
Brian Anderson
bef72447e7
core: Add a scheduler mode, osmain, to spawn onto the main scheduler
2012-04-03 14:28:30 -07:00
Brian Anderson
e1858882a4
rt: Run a single-threaded scheduler on the main thread
2012-04-02 15:35:47 -07:00
Jon Morton
128a8b6ed5
remove rust_srv
2012-04-01 22:18:40 -05:00
Brian Anderson
218dd08469
rt: Introduce rust_sched_reaper
...
This just moves the responsibility for joining with scheduler threads
off to a worker thread. This will be needed when we allow tasks to be
scheduled on the main thread.
2012-03-31 19:51:29 -07:00
Brian Anderson
c414b78afe
rt: Remove the kernel task table
2012-03-15 11:10:52 -07:00
Brian Anderson
b278d675a2
rt: Look up ports through a single port table
...
Instead of a two-level lookup, just use one big table
2012-03-15 11:10:52 -07:00
Brian Anderson
5df44bd066
rt: Remove rust_kernel::live_tasks. Unused
2012-03-01 14:53:20 -08:00
Brian Anderson
7e9aa6c3c2
rt: Don't zero new stacks
2012-02-27 16:13:51 -08:00
Brian Anderson
b3f77bf927
rt: Change the way the kernel exits to avoid pthread leaks
...
This makes the kernel join every scheduler thread before exiting in order to
ensure that all threads are completely terminated before the process exits. On
my machine, for 32-bit targets, this was causing regular valgrind errors.
2012-02-27 14:25:32 -08:00
Jyun-Yan You
b778dac197
fix build on freebsd
2012-02-09 18:41:57 -08:00
Brian Anderson
f2a1aa2649
rt: Hold schedulers in a map
2012-02-08 15:42:51 -08:00
Brian Anderson
7685e5de94
rt: Refactor the rust_kernel interface a bit
2012-02-08 15:42:47 -08:00
Brian Anderson
c76b81cddf
rt: Delete schedulers immediately upon release
...
This will be needed once we support dynamically changing schedulers.
2012-02-08 15:33:40 -08:00
Brian Anderson
f39e64d56a
rt: Change the scheme used for terminating the kernel
...
Instead of joining on the scheduler threads, instead keep a count of active
schedulers. When there are no more schedulers raise a signal for the main
thread to continue.
This will be required once schedulers can be added and removed from the
running kernel.
2012-02-08 15:33:40 -08:00
Brian Anderson
e818406072
rt: Expand rust_kernel::live_tasks to a uintptr_t
2012-02-04 01:15:00 -08:00
Brian Anderson
9fa950ec53
rt: Stop using atomic ops on rust_kernel::live_tasks
...
These ops are all done within spitting distance of a suitable lock,
so just protect it with the lock.
2012-02-04 00:31:43 -08:00