Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocators, take III #1398

Merged
merged 38 commits into from
Apr 8, 2016
Merged

Commits on Dec 6, 2015

  1. Configuration menu
    Copy the full SHA
    80740ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    738ebe3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    af6090f View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2015

  1. typo fix

    steveklabnik committed Dec 7, 2015
    Configuration menu
    Copy the full SHA
    be627c2 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #2 from steveklabnik/patch-1

    typo fix
    pnkfelix committed Dec 7, 2015
    Configuration menu
    Copy the full SHA
    cf0bba1 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2015

  1. Configuration menu
    Copy the full SHA
    e76929e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    087f4c1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    af0b05f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    533bcf8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1fc45cd View commit details
    Browse the repository at this point in the history
  6. fix typo.

    pnkfelix committed Dec 16, 2015
    Configuration menu
    Copy the full SHA
    553d59e View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2016

  1. Configuration menu
    Copy the full SHA
    d9a9f2d View commit details
    Browse the repository at this point in the history
  2. fix a typo.

    pnkfelix committed Mar 16, 2016
    Configuration menu
    Copy the full SHA
    fe88acf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2cdb575 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b6c0050 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5138a32 View commit details
    Browse the repository at this point in the history
  6. alpha-rename Kind to Layout.

    (This really was an improvement, if only because it forced me to
    realize that in some contexts in the text I was using the word "kind"
    to mean something different than the layout structures being passed
    around... which sometimes can seem like a nice pun, but overall I
    suspect it was just a net increase in potential confusion.)
    pnkfelix committed Mar 16, 2016
    Configuration menu
    Copy the full SHA
    4aa94d9 View commit details
    Browse the repository at this point in the history
  7. revised fn oom interface to also take the Self::Error as input, s…

    …o that contextual information can be fed back into the allocator itself.
    
    Though on further review, the comment that inspired this,
      rust-lang#1398 (comment)
    also wanted a `FormatArgs` argument too, so that the client code
    could feed back in arbitrary info.
    pnkfelix committed Mar 16, 2016
    Configuration menu
    Copy the full SHA
    e2d461c View commit details
    Browse the repository at this point in the history
  8. Expanded docs for AllocError trait's methods.

    Added unresolved Q about the new `fn oom` method.
    pnkfelix committed Mar 16, 2016
    Configuration menu
    Copy the full SHA
    05c9635 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a93abd7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    cad7d43 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5ae8038 View commit details
    Browse the repository at this point in the history
  12. amend discussion of &mut self with explicit note about

    why `impl Allocator for &mut MyUniqAlloc` cannot just rely on
    reborrows to handle satisfying `self` parameters.
    pnkfelix committed Mar 16, 2016
    Configuration menu
    Copy the full SHA
    dd485fd View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d9232de View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    2f3034a View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2016

  1. Fix code to reflect that fn dealloc method no longer returns Result.

    Remove `fn dealloc_unchecked` method since it no longer provides any
    benefit over `fn dealloc` anymore, since `fn dealloc` no longer has any
    preconditions to check (*).
    
    (*) Or at least, if it *does* choose to check preconditions (like "was
    the address part of my set of memory blocks?"), there is no longer way
    for `fn dealloc` to signal an error condition besides `panic`, and I
    do not think trying to prepare for that hypothetical scenario is worth
    adding the `fn dealloc_unchecked` method to the API.
    pnkfelix committed Mar 17, 2016
    Configuration menu
    Copy the full SHA
    3a597f9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    40c84c2 View commit details
    Browse the repository at this point in the history
  3. "fixed" oom default method impl (the abort intrinisic requires `u…

    …nsafe`)
    
    (Though to be honest revisiting this made me wonder if I should just
    require clients to implement `fn oom` themselves.)
    pnkfelix committed Mar 17, 2016
    Configuration menu
    Copy the full SHA
    06e2263 View commit details
    Browse the repository at this point in the history
  4. Updated implementation to reflect that Layout (nee Kind) is no lo…

    …nger `Copy`.
    
    (I should have done this as part of the earlier commit that removed
    `deriving(Copy)` from `Layout`.)
    pnkfelix committed Mar 17, 2016
    Configuration menu
    Copy the full SHA
    34d019d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ede39d0 View commit details
    Browse the repository at this point in the history
  6. Added missing Sync impl for DumbBumpPool, and also fixed some pri…

    …vacy oversights from earlier.
    
    The demo code is still not perfect (it currently presumes
    `Vec::new_in` addition, which is not great since another part of the
    RFC now says that standard library integration is specifically not
    addressed by this RFC). I'm working on revising the demo but I don't think
    that should hold up overall discussion.
    pnkfelix committed Mar 17, 2016
    Configuration menu
    Copy the full SHA
    ffdf71e View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2016

  1. lifted the fmt::Debug bound from associated type up to AllocError

    … trait itself.
    
    (The only place where `AllocError` is used is as a bound on that
    associated type, so does not present any additional burden on clients
    of `Allocator` itself, though it does rule out certain pathological
    programmtic constructions that I'm not worried about.)
    pnkfelix committed Mar 18, 2016
    Configuration menu
    Copy the full SHA
    9eae82d View commit details
    Browse the repository at this point in the history
  2. Extended AllocErr enum variants with more contextual info about all…

    …ocation failure cause.
    
    The important one: for `Unsupported` operations, lets have the
    allocator be able to provide more context about what was
    unsupported. (I chose `&'static str` here because that avoids
    allocation integration for the error message, but I would love to be
    convinced that we could employ `Cow<'static, str>` here instead, since
    that would be much more general purpose.)
    
    And since I was adding contextual information anyway, I decided to
    have the memory exhausted variant carry along the particular `Layout`
    straw that broke the camel's back.
    
    (Note that the `MemoryExhausted` *struct* still remains zero-sized.)
    pnkfelix committed Mar 18, 2016
    Configuration menu
    Copy the full SHA
    59ed824 View commit details
    Browse the repository at this point in the history
  3. Added section on allocator trait objects.

    This includes the changes that were absolutely necessary to support
    them in the `Allocator` trait itself, as well as an (opinionated) type
    alias, `AllocatorObj`, for defining allocator trait objects.
    pnkfelix committed Mar 18, 2016
    Configuration menu
    Copy the full SHA
    fe9a9b2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    792eb31 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2016

  1. Most of the changes suggested by feedback during FCP period.

     * Removed associated `Error` type from `Allocator` trait; all methods now use `AllocErr`
       for error type. Removed `AllocError` trait and `MemoryExhausted` error.
    
     * Removed `fn max_size` and `fn max_align` methods; we can put them back later if
       someone demonstrates a need for them.
    
     * Added `fn realloc_in_place`.
    pnkfelix committed Apr 1, 2016
    Configuration menu
    Copy the full SHA
    5a3abd2 View commit details
    Browse the repository at this point in the history
  2. Allow Layout to represent zero-sized layouts. Removed uses of `NonZ…

    …ero`.
    
    Revised specifications of (hopefully all) relevant methods to indicate
    that they may or may not support allocation of zero-sized layouts (but
    they should return an appropriate `Err` when given such).
    
    (Now, the requirement to return an `Err` does imply a branch that
    arguably we would like to avoid. It would be good to double-check
    this, and potentially try to inline the initial checks into the call
    site.)
    pnkfelix committed Apr 1, 2016
    Configuration menu
    Copy the full SHA
    7c2c444 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    117e5fc View commit details
    Browse the repository at this point in the history