MCPcopy Create free account
hub / github.com/golang/mobile / testGoRefMapGrow

Method testGoRefMapGrow

bind/java/SeqTest.java:372–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

370 }
371
372 public void testGoRefMapGrow() {
373 CountI obj = new CountI();
374 Testpkg.keep(obj);
375
376 // Push active references beyond base map size.
377 for (int i = 0; i < 24; i++) {
378 CountI o = new CountI();
379 Testpkg.callF(o);
380 if (i%3==0) {
381 Testpkg.keep(o);
382 }
383 }
384 runGC();
385 for (int i = 0; i < 128; i++) {
386 Testpkg.callF(new CountI());
387 }
388
389 Testpkg.callF(obj); // original object needs to work.
390
391 assertEquals(countI, 1+24+128);
392 }
393
394 private void runGC() {
395 System.gc();

Callers

nothing calls this directly

Calls 1

runGCMethod · 0.95

Tested by

no test coverage detected