[Commits] [wesnoth/wesnoth] ab5fec: Insert lua_unit's contained pointer directly

GitHub noreply at github.com
Thu May 1 19:27:34 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: ab5fec20d9249118d9083231f6f9e671d3df1c4e
      https://github.com/wesnoth/wesnoth/commit/ab5fec20d9249118d9083231f6f9e671d3df1c4e
  Author: Alexander van Gessel <ai0867 at gmail.com>
  Date:   2014-04-26 (Sat, 26 Apr 2014)

  Changed paths:
    M src/scripting/lua.cpp

  Log Message:
  -----------
  Insert lua_unit's contained pointer directly

Not copying the unit improves the speed of wesnoth.put_unit by two orders
of magnitude from lua's perspective.

To do this, we have to take ownership of any owned pointer from lua_unit.
We do this by not running lua_unit's destructor, but just overwriting the memory it's in.


  Commit: 060cc190088e445bc4b122e8135e895096b86cc1
      https://github.com/wesnoth/wesnoth/commit/060cc190088e445bc4b122e8135e895096b86cc1
  Author: Alexander van Gessel <ai0867 at gmail.com>
  Date:   2014-04-28 (Mon, 28 Apr 2014)

  Changed paths:
    M src/scripting/lua.cpp
    M src/scripting/lua_api.cpp
    M src/scripting/lua_api.hpp

  Log Message:
  -----------
  Give lua_unit a put_map member function

This allows us to remove the destructor-avoidance hack in wesnoth.put_unit
and simplify the function's handing of various lua_unit types.


  Commit: 8ab34f0240b0de788a6d2570cb89a130addb7956
      https://github.com/wesnoth/wesnoth/commit/8ab34f0240b0de788a6d2570cb89a130addb7956
  Author: Alexander van Gessel <ai0867 at gmail.com>
  Date:   2014-05-01 (Thu, 01 May 2014)

  Changed paths:
    M src/scripting/lua.cpp
    M src/scripting/lua_api.cpp
    M src/scripting/lua_api.hpp

  Log Message:
  -----------
  Merge branch 'lua_put_unit' (PR #158)


Compare: https://github.com/wesnoth/wesnoth/compare/82e4ccad4dff...8ab34f0240b0


More information about the Commits mailing list