]> git.puffer.fish Git - matthieu/frr.git/commit
lib: remove pure attribute from functions that modify memory
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 18 Jun 2021 10:06:13 +0000 (13:06 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 18 Jun 2021 16:54:40 +0000 (19:54 +0300)
commit4f08c715db6893ff439d0a39bf4506cd26256d13
tree018fb2b4dc62b81d64f74b96d4c50cf1a7404008
parent161b567451593a7a176bc91b5aaafc53a578be75
lib: remove pure attribute from functions that modify memory

Almost all functions currently marked with pure attribute acquire a
route_node lock. By marking them pure we allow compiler to optimize the
code and not call them when it already knows the return value. This is
completely incorrect.

Only two of eleven functions can be marked as pure. And they still won't
be optimized because they are never called from the same function twice.
Let's remove the ext_pure macro completely to reduce the chance of
repeating this mistake in the future.

Fixes #8866, #8809, #8595, #6992.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/compiler.h
lib/table.h