[gegl] buffer: in GeglTileBackendSwap, move reused OP_DESTROY to the top



commit 3275239e26e659b48933ba415a3c7c165f57a31f
Author: Ell <ell_se yahoo com>
Date:   Sat Aug 11 09:13:22 2018 -0400

    buffer: in GeglTileBackendSwap, move reused OP_DESTROY to the top
    
    In gegl_tile_backend_swap_entry_destroy(), when reusing an existing
    queued op as an OP_DESTROY, move the op to the top of the queue, so
    that the corresponding storage is reclaimed before any pending
    WRITE ops.  This used to be the behavior before last commit, which
    accidentally removed it.

 gegl/buffer/gegl-tile-backend-swap.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gegl/buffer/gegl-tile-backend-swap.c b/gegl/buffer/gegl-tile-backend-swap.c
index 563e12455..26515a26f 100644
--- a/gegl/buffer/gegl-tile-backend-swap.c
+++ b/gegl/buffer/gegl-tile-backend-swap.c
@@ -631,6 +631,12 @@ gegl_tile_backend_swap_entry_destroy (GeglTileBackendSwap *self,
       /* reuse the queued op, changing it to an OP_DESTROY. */
       queued_op->operation = OP_DESTROY;
 
+      /* move to op to the top of the queue, so that it gets served before any
+       * write ops, which are then free to reuse the reclaimed space.
+       */
+      g_queue_unlink (queue, link);
+      g_queue_push_head_link (queue, link);
+
       return;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]