Skip to content

Instantly share code, notes, and snippets.

@jonpryor jonpryor/gist:d59a0fc24c812249168d Secret
Last active Aug 29, 2015

What would you like to do?
for (i = 0; i < ELEMENT_COUNT; ++i) {
_log ("-- %i", i);
// writes +g+ message
jobject v = _lref_to_gref (env, _create_integer (env, i), "Integer");;
if ((rand () % 2) == 0) {
// writes +g+ message
grefs [i] = _new_gref (env, v, "Hold-Integer");
// writes +w+ message
wrefs [i] = _new_wref (env, v, "WeakReference(Integer)");
// writes -g- message
_delete_gref (env, v, "Integer");
I/*wref-test*(24886): -- 198
I/*wref-test*(24886): +g+ h=0xd7100019/L[6] -> n=0x6c003d6/G[245] Integer
I/*wref-test*(24886): +w+ h=0x6c003d6/G[245] -> n=0xd00896/G[549] WeakReference(Integer)
I/*wref-test*(24886): -- 199
I/*wref-test*(24886): +g+ h=0xd7300019/L[6] -> n=0x6d003d6/G[245] Integer
I/*wref-test*(24886): +g+ h=0x6d003d6/G[245] -> n=0xc0089a/G[550] Hold-Integer
I/*wref-test*(24886): +w+ h=0x6d003d6/G[245] -> n=0xd0089e/G[551] WeakReference(Integer)
I/*wref-test*(24886): -g- h=0x6d003d6/G[245] Integer
I/*wref-test*(24886): +g+ h=0xd7500019/L[6] -> n=0x6e003d6/G[245] Integer
I/*wref-test*(24886): +w+ h=0x6e003d6/G[245] -> n=0xe008a2/G[552] WeakReference(Integer)
I/*wref-test*(24886): +g+ h=0xd7700019/L[6] -> n=0x6f003d6/G[245] Integer
I/*wref-test*(24886): +g+ h=0x6f003d6/G[245] -> n=0xc008a6/G[553] Hold-Integer
I/*wref-test*(24886): +w+ h=0x6f003d6/G[245] -> n=0xe008aa/G[554] WeakReference(Integer)
I/*wref-test*(24886): -g- h=0x6f003d6/G[245] Integer
I/*wref-test*(24886): -- 202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.