1. 15 Dec, 2016 1 commit
  2. 09 Nov, 2016 2 commits
  3. 03 Nov, 2016 4 commits
  4. 16 Oct, 2016 1 commit
  5. 09 Sep, 2016 1 commit
  6. 12 Aug, 2016 6 commits
  7. 11 Aug, 2016 3 commits
    • ticki's avatar
      Make TLS optional. · ae4fc625
      ticki authored
      This feature was requested by @jackpot51, and will be used until Redox gets full TLS support.
    • ticki's avatar
      The test suite runs! Ralloc 1.0.0 is ready! · 70104b8d
      ticki authored
    • ticki's avatar
      Fix bug related to strange behavior of Arc · 5285a72b
      ticki authored
      Apparently, atomically reference counted objects would allow destructors to run after the allocator had been deinitialized. To fix this, we make sure the allocator is never disabled, but simply will fallback to the global alloctor when deinitialized. This also fixes an important bug in TLS keys (i.e. the order of the thread dtors were unknown).
      We introduce a few other smaller changes as well:
      - Use uniform convention for todos. Add a colon after the TODO, and start with capital letter, and end with punctuation.
      - Fix broken tests which would free a larger buffer than allocated.
      - Remove debug_tools in favor of planned Valgrind compatibility.
      - Remove `LazyInit`'s unreachable state.
      - Replace `get_allocator` with a macro (due to the lack of generic closures).
  8. 10 Aug, 2016 2 commits
    • ticki's avatar
      Improve logging in multiple ways. · fd7a7bc7
      ticki authored
      - Let `Writer` hold the lock.
      - Rename `Writer` to `LogWriter`
      - Fix warnings in tests.
      - Remove forgotten file.
    • ticki's avatar
      Make use of .expect() over .unwrap() · 8b438f18
      ticki authored
      It is generally considered better to do so, due to the more descriptive error messages.
      - Remove warnings from the minimal.rs test
  9. 09 Aug, 2016 5 commits
  10. 08 Aug, 2016 6 commits
    • ticki's avatar
      Move assertion in `push` into conditional · e7e3706b
      ticki authored
      Empty blocks might not be well-formed in address, but the assertion hits even though it is empty.
    • ticki's avatar
      Logging symbols for shim · 453db854
      ticki authored
      To allow custom logging target, we replace the direct libc symbols by an import from the shim crate, which can then be replace to match desired behavior.
    • ticki's avatar
      Move the line lock to the `write` model. · c139b44e
      ticki authored
      Assertions previously cluttered too, this fixes it by doing the same (i.e. locking a line lock) in the assertion macros.
    • ticki's avatar
      Avoid unbounded metacircular reservations. · 48cf15ff
      ticki authored
      `reserve` would previously do unbounded recursion. We fix this by adding a field, set if the bookkeeper is reserving, if so, the reservation will be skipped.
    • ticki's avatar
      Add a per-line lock · 1186e427
      ticki authored
      Log lines got mangled together previously, making the log unreadable. For multithreaded applications, this is rather annoying, for this reason we add a lock which is locked for every line ensuring atomicity.
    • ticki's avatar
      Fix reserve (called by insert) to not modify the order · 302678da
      ticki authored
      Previously it broke indexes (or their association with blocks).
  11. 07 Aug, 2016 6 commits
    • ticki's avatar
      Fix bug breaking the 4th assumption of the Bookkeeper · ad5d2d63
      ticki authored
      The problem was that the reservation did not reserve the additional extra elements in certain cases.
      Secondly, we add a FIXME for `insert`, which is most likely broken.
    • ticki's avatar
      Increase EXTRA_ELEMENTS, fix a bug in `reserve` which forces the length to increase. · 8e8727c7
      ticki authored
      These are simply dumb bugs that was left overseen in previous commit.
    • ticki's avatar
      Add Bookkeeper IDs · 180fdbdd
      ticki authored
      This improves the logging by adding a way to distinguish between allocators (namely local and global).
      - Fix a bug related to a malformed assertion in Bookkeeper::push().
    • ticki's avatar
      Fix broken assertion · ddad677c
      ticki authored
      The first assertion in Bookkeeper::push was broken due to executing when the vector is empty triggering an out-of-bound panic.
    • ticki's avatar
      Fix unsoundness in TLS · 863a1ece
      ticki authored
      The API was unsound due to allowing leakage of a reference to another thread. We solve this in a manner similar to libstd, by using a `with` method, which temporarily gives access through a reference by taking a closure. Related to [RFC 1705](https://github.com/rust-lang/rfcs/pull/1705).
    • ticki's avatar
      Ralloc 1.0.0: A trait-based local/global allocator model. · cdec4b0e
      ticki authored
      - Use a trait-based approach to local/global allocators. In particular,
        we make what was previously provided by `Bookkeeper` to a trait in
        which the custom methods are overriden.
      - Enable ralloc-based block list reallocation. Instead of using BRK for
        this, we allow the allocator itself to manage the bookkeeper's
        capacity. This is done by adding the guarantee of the vector's
        capacity always being greater than or equal two the length plus two.
      - Remove the `UniCell` primitive and provides a `MoveCell` primitive
      - Move `Bookkeeper`-specific methods to `Bookkeeper`'s impl instead of
        the `Allocator` trait.
      - Introduce the `LazyInit` primitive, which provides functionality
        similar to the `lazy_static` crate. In particular, it allows for an
        initializer to be executed if initialization is needed. This is used
        for allocating the initial segment.
      - Use lonely method for allocation API (abolish `lock`, which is no
        longer relevant due to the new model).
      - Due to an unsoundness discovered by @NilSet, we remove the correctness
        guarantee of the "seperate deallocation" example.
      - Remove microcaches. This method is outdated with the new model. In the
        future, it will likely be replaced by a small-allocation LL arena.
      - Wrap TLS variables in a newtype that guarantees against crossthread
      - Update the tests.
  12. 29 Jul, 2016 1 commit
    • ticki's avatar
      Performance pass for ralloc: global-local allocator model, TLS allocator, and more · c8adc1ea
      ticki authored
      - Ralloc now has a global-local allocator model where the local allocator requests memory from the global allocator. This allows for...
      - ...thread-local storage allocators. The local allocator stores the allocator in a TLS static, bypassing the mutex.
      - Changes to OOM handling: the OOM handleris no longer allocator-specific, but instead global
      - Thread-local OOMs
      - Tweak canonicalization.
      - Add UniCell primive, which allow for single-threaded mutexes
      - Tests and stuff.
  13. 19 Jul, 2016 1 commit
  14. 18 Jul, 2016 1 commit
    • ticki's avatar
      Improve testing suite, improve security, improve logging, global OOM handler,... · 6e3426f3
      ticki authored
      Improve testing suite, improve security, improve logging, global OOM handler, prepare for performance pass
      This patch has the main intend of preparing for the performance pass, along with a set of other changes:
      - Add acid (generative) testing: Set up chaotic and unusual environment for testing, hopefully detecting edge case bugs. This includes doing allocation inbetween tests and setting up multiple threads for detecting data races.
      - Fix casts: Unchecked casts can - in some cases - lead to security issues. In particular, you might be able to shrink the data segment of the process by resulting in overflowing casts.
      - Global OOM handler: The OOM handler is no longer allocator-specific. This is due to a planned new model, where we utilize global-to-local allocators through thread-local storage.
      - Use ranges instead of tuples: Ranges describes the behavior in a more precise manner, and furthermore it is non-affine, allowing for detection of certain logic bugs.
      - Better logging: Now range cursors can be given, with the output syntax []. Cursors are defined through the Cursor trait.
      - General style improvement: Various cleanups of Nilset's code (shame, shame, shame! jk)
      - Replace certain cfg-flags with cfg-macros: This allows all-path-checking, e.g. erroring even when the flag isn't set.
      - Make SBRK unsafe: Due to breakage when shrinking the segment, SBRK is now marked unsafe.
      - Enable more clippy lints: These includes checking the castings and other things. Many false-positives are generated. These needs to be manually fixed by allow-attributes.
      - Update the README: Just a bunch of new rambling onreview process etc.
      - New tests: This includes many new tests including tests for very big allocations and partial allocations.
      Fix #27.