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

Disallow struct layout changes #735

Merged
merged 3 commits into from Jan 9, 2020
Merged

Commits on Jan 9, 2020

  1. Disallow struct layout changes

    This seems like not only an odd feature, but a bad/dangerous one.
    When the layout has been used for any existing objects, changing it will produce
    very difficult-to-diagnose bugs (at least) or potentially memory violations
    if the layout is re-retrieved from the class and used for previous pointers.
    
    It was heavily used in the specs to overwrite one and the same class multiple times to change the layout immediatelly before the test.
    However this use case is specific to testing and should not be used anyway.
    
    Fixes ffi#734
    larskanis committed Jan 9, 2020
    Copy the full SHA
    44008db View commit details
    Browse the repository at this point in the history
  2. Namespace all benchmarks since they are loaded into one process

    This is a follow-up to the previous commit.
    The benchmarks also made use of the redefinition feature of struct layouts.
    Namespacing avoids redefinition, but uses separate classes for all structs.
    larskanis committed Jan 9, 2020
    Copy the full SHA
    bd45ff5 View commit details
    Browse the repository at this point in the history
  3. Warn about Struct layout redefinition only

    Since raising an exception is an API change but it doesn't justify a major version bump, just warn in that case.
    larskanis committed Jan 9, 2020
    Copy the full SHA
    89f4258 View commit details
    Browse the repository at this point in the history