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

Fix OSX build on 1.20 nightly. #221

Merged
merged 5 commits into from Jul 12, 2017

Conversation

Projects
None yet
3 participants
@DavidDeSimone
Collaborator

DavidDeSimone commented Jul 9, 2017

Updating the custom MacOSX allocator to use the new Global Allocator API, that was recently merged as part of 1.20 nightly. This API is considered unstable, but we will attempt to keep up with a moving target.

Information on this API was gathered from rust-lang/rfcs#1974 (comment) and rust-lang/rust#32838

Work to still be done:

  • Fix compilation issues with OSX build on 1.20 nightly
  • Verify that all needed functions of trait Allocator are being implemented.
  • Verify that linux/windows builds are unaffected by this
  • Add usage of AllocErr in cases of allocation error, do not always blindly assume allocation succeeded.

DavidDeSimone added some commits Jul 9, 2017

Updating the custom MacOSX allocator to use the new Global Allocator …
…API, that was recently merged as part of 1.20 nightly. This API is considered unstable, but we will attempt to keep up with a moving target.
layout: Layout,
new_layout: Layout,
) -> Result<*mut u8, AllocErr> {
let addr = unexec_realloc(ptr as *mut libc::c_void, layout.size() as libc::size_t) as usize;

This comment has been minimized.

@DavidDeSimone

DavidDeSimone Jul 10, 2017

Collaborator

this should be new_layout.size(), not layout.size()

DavidDeSimone added some commits Jul 10, 2017

Fixing issue where OSXAllocator's realloc call was using the old layo…
…ut size instead of the new requested realloc size. This would cause bizzare allocation related bugs in remacs. Removing OSXAllocator's implementation of alloc_zeroed, as the default implementation for the trait is 'good enough' for our usage
@DavidDeSimone

This comment has been minimized.

Collaborator

DavidDeSimone commented Jul 10, 2017

@pnkfelix Would you mind taking a look at this PR when you get a chance?

@Wilfred

Seems fine to me, but I'm really not familiar with this part of Rust.

@Wilfred

This comment has been minimized.

Owner

Wilfred commented Jul 12, 2017

@DavidDeSimone do you still consider this WIP, or should we look at merging this? It would be nice to get the build green again, and will help other contributors.

@DavidDeSimone DavidDeSimone changed the title from [WIP] Fix OSX build on 1.20 nightly. to Fix OSX build on 1.20 nightly. Jul 12, 2017

@DavidDeSimone

This comment has been minimized.

Collaborator

DavidDeSimone commented Jul 12, 2017

I think this is good enough for merge, if no one else has any objections. I have removed the WIP tag.

@Wilfred Wilfred merged commit d6c838a into Wilfred:master Jul 12, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Wilfred

This comment has been minimized.

Owner

Wilfred commented Jul 12, 2017

Groovy.

@DavidDeSimone DavidDeSimone deleted the DavidDeSimone:nightly-alloc-fix branch Jul 13, 2017

// by the compiler, but this is a future extension and are required to match
// what is found below.
//
// Note that the standard `malloc` and `realloc` functions do not provide a way

This comment has been minimized.

@pnkfelix

pnkfelix Jul 13, 2017

Contributor

(I would have kept these comments around, but that's personal preference. 😉 )

@pnkfelix

This comment has been minimized.

Contributor

pnkfelix commented Jul 13, 2017

(sorry for not seeing this sooner. Looks fine to me!)

@Wilfred

This comment has been minimized.

Owner

Wilfred commented Jul 14, 2017

Thanks for following up @pnkfelix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment