1.1 --- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp Tue Aug 12 17:46:16 2014 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp Mon Aug 04 10:49:40 2014 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -47,6 +47,13 @@ 1.11 // active field set to true. 1.12 PtrQueue(qset_, perm, true /* active */) { } 1.13 1.14 + // Flush before destroying; queue may be used to capture pending work while 1.15 + // doing something else, with auto-flush on completion. 1.16 + ~DirtyCardQueue() { if (!is_permanent()) flush(); } 1.17 + 1.18 + // Process queue entries and release resources. 1.19 + void flush() { flush_impl(); } 1.20 + 1.21 // Apply the closure to all elements, and reset the index to make the 1.22 // buffer empty. If a closure application returns "false", return 1.23 // "false" immediately, halting the iteration. If "consume" is true,