Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upResource tracking and destruction #633
Conversation
kvark
added
status: working
module: structure
status: blocked
and removed
status: working
labels
Mar 7, 2015
This comment has been minimized.
This comment has been minimized.
|
Nice! |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Mar 7, 2015
|
Looks good so far. |
kvark
added some commits
Mar 7, 2015
kvark
force-pushed the
kvark:resource
branch
from
34f88e2
to
736a4c2
Mar 8, 2015
ghost
reviewed
Mar 8, 2015
src/device/handle.rs
Outdated
| use alloc::arc::{strong_count, weak_count}; | ||
| use std::ops::Deref; | ||
| vector.retain(|v| { | ||
| strong_count(v) > 1 || weak_count(v) > 1 || { |
This comment has been minimized.
This comment has been minimized.
ghost
Mar 8, 2015
can we just use an if? this is a bit to tricky.
let free = !(strong_count(v) > 1 || weak_count(v) > 1);
if free { fun(param, v.deref()); }
!free
This comment has been minimized.
This comment has been minimized.
This was referenced Mar 8, 2015
kvark
force-pushed the
kvark:resource
branch
from
736a4c2
to
dab5635
Mar 8, 2015
kvark
added some commits
Mar 8, 2015
kvark
changed the title
[WIP] Resource tracking and destruction
Resource tracking and destruction
Mar 8, 2015
This comment has been minimized.
This comment has been minimized.
ghost
commented
Mar 8, 2015
This comment has been minimized.
This comment has been minimized.
|
Looks good. |
This comment has been minimized.
This comment has been minimized.
|
Is this still blocked? |
This comment has been minimized.
This comment has been minimized.
|
No, I forgot to change the issue status. It's all ready. Regards,
|
This comment has been minimized.
This comment has been minimized.
|
Ok, I'll merge! |
bvssvni
added a commit
that referenced
this pull request
Mar 8, 2015
bvssvni
merged commit ff213e1
into
gfx-rs:master
Mar 8, 2015
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
bvssvni
removed
the
status: blocked
label
Mar 8, 2015
kvark
deleted the
kvark:resource
branch
Mar 8, 2015
This was referenced Mar 8, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
kvark commentedMar 7, 2015
Implements automatic management of the resources. Works just like RAII.
Closes #288, #617
User API changes:
factory.delete_something()any more!RendererandFactoryaccept all handles by reference to avoid cloningFactoryworks withRawBuffertype natively now instead ofBuffer<()>device.after_frame()afterglfw.swap_buffers()TODO:
handle::Manager)after_free()