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

Remove almost all unsafe code and fixed a memory leak in Evtree #2

Merged
merged 16 commits into from Jul 12, 2020

Conversation

Neopallium
Copy link
Contributor

The only unsafe left is in the IterMut and the parent references. Down to only 7 unsafe usages in radiate_matrix_evtree crate and no unsafe in the other crates.

Split Evtree so that the tree code is now generic and separate from the NeuralNetwork & Genome logic.

Fixed the level order iterator (it was returning all left node first) and added some unit tests to test the iterators.

The only way to remove the remaining unsafe code would be to use something like Rc<RefCell<>> and Weak references for the parent.

@pkalivas pkalivas merged commit e091cb7 into pkalivas:master Jul 12, 2020
@pkalivas
Copy link
Owner

Thanks for this, I appreciate the time/work form a more experienced rust developer. I just update radiate (1.1.55) and evtree (1.0.1) on crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants