Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The pointer in the slice must not be null, because enum representations make that assumption. The `exchange_malloc` function returns a non-null sentinel for the zero size case, and it must not be passed to the `exchange_free` lang item. Since the length is always equal to the true capacity, a branch on the length is enough for most types. Slices of zero size types are statically special cased to never attempt deallocation. This is the same implementation as `Vec<T>`. Closes #14395
- Loading branch information
1 parent
b625d43
commit 9639caf
Showing
4 changed files
with
24 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9639caf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from cmr
at https://github.com/thestinger/rust/commit/9639cafd3625429ea558d3202cffdfc851fcf9cf
9639caf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging thestinger/rust/dst = 9639caf into auto
9639caf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thestinger/rust/dst = 9639caf merged ok, testing candidate = 1f4117f
9639caf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1300
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1299
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1299
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1300
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1294
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1293
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1294
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1298
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1293
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1293
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1297
success: http://buildbot.rust-lang.org/builders/auto-win32-32-opt/builds/130
success: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-t/builds/130
success: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-c/builds/130
success: http://buildbot.rust-lang.org/builders/auto-win64-64-opt/builds/130
success: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-t/builds/130
success: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-c/builds/130
9639caf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 1f4117f