src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp

changeset 7476
c2844108a708
parent 6930
570cb6369f17
parent 7445
42c091d63c72
child 7535
7ae4e26cb1e0
     1.1 --- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp	Wed Oct 22 11:18:17 2014 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp	Thu Oct 23 12:02:08 2014 -0700
     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,

mercurial