roboptim / roboptim-core

RobOptim Core Layer: interface and basic mathematical tools
http://www.roboptim.net
GNU Lesser General Public License v3.0
64 stars 35 forks source link

Note on set_is_malloc_allowed #88

Closed bchretien closed 9 years ago

bchretien commented 9 years ago

We should wrap the calls to/reimplement Eigen::set_is_malloc_allowed since it modifies a static variable in an Eigen method, and a different variable may be updated when someone using RobOptim wants to update the same variable:

inline bool is_malloc_allowed_impl(bool update, bool new_value = false)
{
  static bool value = true;
  if (update == 1)
    value = new_value;
  return value;
}