1. 19 8月, 2014 1 次提交
  2. 14 7月, 2014 1 次提交
    • A
      Stabilization for `owned` (now `boxed`) and `cell` · e0ede9c6
      Aaron Turon 提交于
      This PR is the outcome of the library stabilization meeting for the
      `liballoc::owned` and `libcore::cell` modules.
      
      Aside from the stability attributes, there are a few breaking changes:
      
      * The `owned` modules is now named `boxed`, to better represent its
        contents. (`box` was unavailable, since it's a keyword.) This will
        help avoid the misconception that `Box` plays a special role wrt
        ownership.
      
      * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
        method is renamed to `downcast`, in both cases to improve clarity.
      
      * The recently-added `AnySendOwnExt` extension trait is removed; it was
        not being used and is unnecessary.
      
      [breaking-change]
      e0ede9c6
  3. 30 6月, 2014 1 次提交
  4. 29 6月, 2014 1 次提交
  5. 13 6月, 2014 1 次提交
  6. 07 6月, 2014 1 次提交
    • A
      std: Extract librustrt out of libstd · 5ec36c35
      Alex Crichton 提交于
      As part of the libstd facade efforts, this commit extracts the runtime interface
      out of the standard library into a standalone crate, librustrt. This crate will
      provide the following services:
      
      * Definition of the rtio interface
      * Definition of the Runtime interface
      * Implementation of the Task structure
      * Implementation of task-local-data
      * Implementation of task failure via unwinding via libunwind
      * Implementation of runtime initialization and shutdown
      * Implementation of thread-local-storage for the local rust Task
      
      Notably, this crate avoids the following services:
      
      * Thread creation and destruction. The crate does not require the knowledge of
        an OS threading system, and as a result it seemed best to leave out the
        `rt::thread` module from librustrt. The librustrt module does depend on
        mutexes, however.
      * Implementation of backtraces. There is no inherent requirement for the runtime
        to be able to generate backtraces. As will be discussed later, this
        functionality continues to live in libstd rather than librustrt.
      
      As usual, a number of architectural changes were required to make this crate
      possible. Users of "stable" functionality will not be impacted by this change,
      but users of the `std::rt` module will likely note the changes. A list of
      architectural changes made is:
      
      * The stdout/stderr handles no longer live directly inside of the `Task`
        structure. This is a consequence of librustrt not knowing about `std::io`.
        These two handles are now stored inside of task-local-data.
      
        The handles were originally stored inside of the `Task` for perf reasons, and
        TLD is not currently as fast as it could be. For comparison, 100k prints goes
        from 59ms to 68ms (a 15% slowdown). This appeared to me to be an acceptable
        perf loss for the successful extraction of a librustrt crate.
      
      * The `rtio` module was forced to duplicate more functionality of `std::io`. As
        the module no longer depends on `std::io`, `rtio` now defines structures such
        as socket addresses, addrinfo fiddly bits, etc. The primary change made was
        that `rtio` now defines its own `IoError` type. This type is distinct from
        `std::io::IoError` in that it does not have an enum for what error occurred,
        but rather a platform-specific error code.
      
        The native and green libraries will be updated in later commits for this
        change, and the bulk of this effort was put behind updating the two libraries
        for this change (with `rtio`).
      
      * Printing a message on task failure (along with the backtrace) continues to
        live in libstd, not in librustrt. This is a consequence of the above decision
        to move the stdout/stderr handles to TLD rather than inside the `Task` itself.
        The unwinding API now supports registration of global callback functions which
        will be invoked when a task fails, allowing for libstd to register a function
        to print a message and a backtrace.
      
        The API for registering a callback is experimental and unsafe, as the
        ramifications of running code on unwinding is pretty hairy.
      
      * The `std::unstable::mutex` module has moved to `std::rt::mutex`.
      
      * The `std::unstable::sync` module has been moved to `std::rt::exclusive` and
        the type has been rewritten to not internally have an Arc and to have an RAII
        guard structure when locking. Old code should stop using `Exclusive` in favor
        of the primitives in `libsync`, but if necessary, old code should port to
        `Arc<Exclusive<T>>`.
      
      * The local heap has been stripped down to have fewer debugging options. None of
        these were tested, and none of these have been used in a very long time.
      
      [breaking-change]
      5ec36c35
  7. 11 5月, 2014 1 次提交
    • A
      core: Remove the cast module · f94d671b
      Alex Crichton 提交于
      This commit revisits the `cast` module in libcore and libstd, and scrutinizes
      all functions inside of it. The result was to remove the `cast` module entirely,
      folding all functionality into the `mem` module. Specifically, this is the fate
      of each function in the `cast` module.
      
      * transmute - This function was moved to `mem`, but it is now marked as
                    #[unstable]. This is due to planned changes to the `transmute`
                    function and how it can be invoked (see the #[unstable] comment).
                    For more information, see RFC 5 and #12898
      
      * transmute_copy - This function was moved to `mem`, with clarification that is
                         is not an error to invoke it with T/U that are different
                         sizes, but rather that it is strongly discouraged. This
                         function is now #[stable]
      
      * forget - This function was moved to `mem` and marked #[stable]
      
      * bump_box_refcount - This function was removed due to the deprecation of
                            managed boxes as well as its questionable utility.
      
      * transmute_mut - This function was previously deprecated, and removed as part
                        of this commit.
      
      * transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                               can be achieved with an `as` in safe code, so it was
                               removed.
      
      * transmute_lifetime - This function was removed because it is likely a strong
                             indication that code is incorrect in the first place.
      
      * transmute_mut_lifetime - This function was removed for the same reasons as
                                 `transmute_lifetime`
      
      * copy_lifetime - This function was moved to `mem`, but it is marked
                        `#[unstable]` now due to the likelihood of being removed in
                        the future if it is found to not be very useful.
      
      * copy_mut_lifetime - This function was also moved to `mem`, but had the same
                            treatment as `copy_lifetime`.
      
      * copy_lifetime_vec - This function was removed because it is not used today,
                            and its existence is not necessary with DST
                            (copy_lifetime will suffice).
      
      In summary, the cast module was stripped down to these functions, and then the
      functions were moved to the `mem` module.
      
          transmute - #[unstable]
          transmute_copy - #[stable]
          forget - #[stable]
          copy_lifetime - #[unstable]
          copy_mut_lifetime - #[unstable]
      
      [breaking-change]
      f94d671b
  8. 07 5月, 2014 1 次提交
    • P
      librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except · 090040bf
      Patrick Walton 提交于
      for `~str`/`~[]`.
      
      Note that `~self` still remains, since I forgot to add support for
      `Box<self>` before the snapshot.
      
      How to update your code:
      
      * Instead of `~EXPR`, you should write `box EXPR`.
      
      * Instead of `~TYPE`, you should write `Box<Type>`.
      
      * Instead of `~PATTERN`, you should write `box PATTERN`.
      
      [breaking-change]
      090040bf
  9. 21 4月, 2014 1 次提交
  10. 16 4月, 2014 2 次提交
  11. 08 4月, 2014 1 次提交
    • B
      Improve searching for XXX in tidy script (#3303) · 00cbda2d
      Boris Egorov 提交于
      Few places where previous version of tidy script cannot find XXX:
      * inside one-line comment preceding by a few spaces;
      * inside multiline comments (now it finds it if multiline comment starts
      on the same line with XXX).
      
      Change occurences of XXX found by new tidy script.
      00cbda2d
  12. 01 4月, 2014 1 次提交
  13. 29 3月, 2014 1 次提交
  14. 28 2月, 2014 1 次提交
  15. 23 1月, 2014 1 次提交
  16. 22 1月, 2014 1 次提交
  17. 08 1月, 2014 1 次提交
  18. 02 1月, 2014 1 次提交
    • A
      Move task count bookeeping out of libstd · 3f11f873
      Alex Crichton 提交于
      For libgreen, bookeeping should not be global but rather on a per-pool basis.
      Inside libnative, it's known that there must be a global counter with a
      mutex/cvar.
      
      The benefit of taking this strategy is to remove this functionality from libstd
      to allow fine-grained control of it through libnative/libgreen. Notably, helper
      threads in libnative can manually decrement the global count so they don't count
      towards the global count of threads. Also, the shutdown process of *all* sched
      pools is now dependent on the number of tasks in the pool being 0 rather than
      this only being a hardcoded solution for the initial sched pool in libgreen.
      
      This involved adding a Local::try_take() method on the Local trait in order for
      the channel wakeup to work inside of libgreen. The channel send was happening
      from a SchedTask when there is no Task available in TLS, and now this is
      possible to work (remote wakeups are always possible, just a little slower).
      3f11f873
  19. 01 1月, 2014 1 次提交
  20. 26 12月, 2013 1 次提交
    • A
      Test fixes and rebase conflicts · 6cad8f4f
      Alex Crichton 提交于
      * vec::raw::to_ptr is gone
      * Pausible => Pausable
      * Removing @
      * Calling the main task "<main>"
      * Removing unused imports
      * Removing unused mut
      * Bringing some libextra tests up to date
      * Allowing compiletest to work at stage0
      * Fixing the bootstrap-from-c rmake tests
      * assert => rtassert in a few cases
      * printing to stderr instead of stdout in fail!()
      6cad8f4f
  21. 25 12月, 2013 1 次提交
  22. 17 12月, 2013 1 次提交
  23. 11 12月, 2013 1 次提交
  24. 08 12月, 2013 1 次提交
  25. 07 12月, 2013 1 次提交
  26. 29 11月, 2013 1 次提交
  27. 28 11月, 2013 2 次提交
  28. 27 11月, 2013 3 次提交
    • A
      Clean up statically initialized data on shutdown · ed86b48c
      Alex Crichton 提交于
      Whenever the runtime is shut down, add a few hooks to clean up some of the
      statically initialized data of the runtime. Note that this is an unsafe
      operation because there's no guarantee on behalf of the runtime that there's no
      other code running which is using the runtime.
      
      This helps turn down the noise a bit in the valgrind output related to
      statically initialized mutexes. It doesn't turn the noise down to 0 because
      there are still statically initialized mutexes in dynamic_lib and
      os::with_env_lock, but I believe that it would be easy enough to add exceptions
      for those cases and I don't think that it's the runtime's job to go and clean up
      that data.
      ed86b48c
    • D
      port the runtime to `#[thread_local]` · 2cf3d8ad
      Daniel Micay 提交于
      2cf3d8ad
    • P
      1eca34de
  29. 20 11月, 2013 1 次提交
  30. 19 11月, 2013 1 次提交
    • A
      Remove the C++ lock_and_signal type · e8bf0788
      Alex Crichton 提交于
      A the same time this purges all runtime support needed for statically
      initialized mutexes, moving all users over to the new Mutex type instead.
      e8bf0788
  31. 12 11月, 2013 1 次提交
    • A
      Remove #[fixed_stack_segment] and #[rust_stack] · 7755ffd0
      Alex Crichton 提交于
      These two attributes are no longer useful now that Rust has decided to leave
      segmented stacks behind. It is assumed that the rust task's stack is always
      large enough to make an FFI call (due to the stack being very large).
      
      There's always the case of stack overflow, however, to consider. This does not
      change the behavior of stack overflow in Rust. This is still normally triggered
      by the __morestack function and aborts the whole process.
      
      C stack overflow will continue to corrupt the stack, however (as it did before
      this commit as well). The future improvement of a guard page at the end of every
      rust stack is still unimplemented and is intended to be the mechanism through
      which we attempt to detect C stack overflow.
      
      Closes #8822
      Closes #10155
      7755ffd0
  32. 11 10月, 2013 1 次提交
  33. 26 9月, 2013 1 次提交
    • A
      Don't die in try_unsafe_borrow if tls isn't ready · 324418f3
      Alex Crichton 提交于
      If there's no TLS key just yet, then there's nothing to unsafely borrow, so
      continue returning None. This prevents causing the runtime to abort itself when
      logging before the runtime is fully initialized.
      
      Closes #9487
      324418f3
  34. 29 8月, 2013 1 次提交
  35. 25 8月, 2013 2 次提交