Robin Gareus 520dcf8cdf rework lua-bridge C++ variable references
Since lua functions are closures, C++ methods that pass arguments by
reference cannot be used directly. The previous approach (boost::ref)
failed with clang. Assume the following:

  void foo (float&) { }
  static inline float& bar () {
    boost::reference_wrapper<float> r (42);
    return r.get ();
  }

  foo ( bar () );

With gcc, "r" goes out of scope after foo's arguments are processed
and all is well.
But with clang,  "r" already leave scope when *inlined* bar() returns.

Solution: allocate some user-data on the lua-stack to hold the reference.
There is no reference to this user-data so lua will eventually
garbage collect it.

(theoretically, creating the table which holds the return-values
could trigger an emergency garbage collection when memory is low and
free the reference just while they're being pushed to the table, then
gain FuncArgs<Params> already dereferenced them all as variable on the
C stack -- probably again compiler specific)
2016-07-18 23:52:40 +02:00
2016-02-28 21:16:44 +01:00
2016-02-28 21:16:44 +01:00
2016-07-18 15:05:50 +02:00
2016-07-18 17:37:13 +02:00
2016-06-25 00:44:04 +02:00
2016-07-06 03:12:19 +02:00
2009-11-09 14:13:59 +00:00
2013-03-12 13:32:56 -04:00
2015-05-09 13:08:56 -04:00
2013-03-13 14:35:39 -04:00
2016-06-01 00:00:04 +02:00
2016-02-28 21:48:49 +01:00

Please see the Ardour web site at http://ardour.org/ for all documentation..

For information on building ardour: 
      
     http://ardour.org/development.html
Description
No description provided
Readme 198 MiB
Languages
C++ 56.5%
C 39.6%
JavaScript 1.3%
Lua 0.9%
Python 0.6%
Other 0.9%