Added simple example for imcompatible allocators #33
Draft
vikashsiwach wants to merge 4 commits intorustfoundation:mainfrom
Draft
Added simple example for imcompatible allocators #33vikashsiwach wants to merge 4 commits intorustfoundation:mainfrom
vikashsiwach wants to merge 4 commits intorustfoundation:mainfrom
Conversation
Collaborator
|
Hi, thanks for this example! I've already seen your first PR in #24, let's focus on one PR at a time. Once that PR has finished, we can decide what to do with this one. I'll mark this PR as draft until then. |
dbe2698 to
b2b8b93
Compare
b2b8b93 to
85c2b19
Compare
Contributor
Author
|
I have updated the project structure with different folder for incompatible allocators example. I have added run.sh file for CI. It is passing now all checks. @teor2345 I request you to review the PR and give your feedback. |
Collaborator
Sorry, we're focusing on one PR per person for now. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a minimal example demonstrating the "incompatible_allocators" problem between Rust and C++.
The example shows a case where memory is allocated in Rust and ownership is transferred to C++, which then attempts to deallocate it using a different allocator. This results in undefined behavior.
What this example demonstrates
vec)free()Why this is useful
This example highlights that allocator compatibility is equally important.
Notes
Future work (optional)
This example could be extended to include:
Boxor other allocation patterns