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

Fixes for issues 8332 and 8333 #736

Closed
wants to merge 3 commits into from
Closed

Fixes for issues 8332 and 8333 #736

wants to merge 3 commits into from

Commits on Aug 26, 2012

  1. Fixes for issues 8332 and 8333

    Consolidating error management
    monarchdodra committed Aug 26, 2012
    Configuration menu
    Copy the full SHA
    6e26b55 View commit details
    Browse the repository at this point in the history
  2. Fixes for issue 8591 (nothrow)

    Makes "refCountedPayload" nothrow when
    ``autoInit == RefCountedAutoInitialize.no``
    
    Also makes Payload.isInitialized nothrow
    monarchdodra committed Aug 26, 2012
    Configuration menu
    Copy the full SHA
    db4ce80 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2012

  1. Arry: new operators,new bounds checking scheme

    Big Changes for Array:
    
    First: I added some new operators:
    The range wide opUnary and opOpBinary operators, that allow doing an operation on all elements. This was added on Array.Range only (not on Array itself): This is to stay close to native array's behavior:
    a += 5;//error with both native arrays and Array
    a[] += 5; //OK with both native arrays and Array
    
    Second: Added an invariant: Extracting a range from an Array forces that array's initialization. This is actually VERY valuable, and aids us in a twofold manner:
    #1: Performance: None of the range's operations need to validate that _data is initialized.
    #2: Provided the *assert* "_b <= _outer.length", we are guaranteed that "_outer._data._payload[_a .. _b]" is valid, making for quick and easy slicing.
    
    Second: A *big* change in philosophy regarding bounds checking: First, both Array and Array.Range implement a private "get" method that always returns a valid raw array (see implementation for details). This has two advantages
    #1: Centralized logic: Once we have a valid slice, every "op" implementation become trivially simple, and become nothing more that a forward to get's range:
    #2: Since we are operating on valid slices, we can rely on the language's array bounds checking for bounds enforcement: This actually makes the error messages more verbose, while costing less in developer code, executable size and run-time.
    monarchdodra committed Aug 27, 2012
    Configuration menu
    Copy the full SHA
    725af03 View commit details
    Browse the repository at this point in the history