Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32d0572a authored by Julia Lawall's avatar Julia Lawall Committed by Masahiro Yamada
Browse files

coccinelle: mini_lock: improve performance



Replace <+... ...+> by ... when any.  <+... ...+> is slow, and in some
obscure cases involving backward jumps it doesn't force the unlock to
actually come after the end of the if.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 4c1d9bb0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -67,12 +67,14 @@ identifier lock,unlock;
@@

*lock(E1@p,...);
<+... when != E1
... when != E1
    when any
if (...) {
  ... when != E1
*  return@r ...;
}
...+>
... when != E1
    when any
*unlock@up(E1,...);

@script:python depends on org@