Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LUA is FFOC

Name: Anonymous 2011-02-05 9:01

LUA is the toy language for those who enjoy the Forced Flushing Of L1/L2 Cache per operation. In fact, every operation causes several L2 cache misses during table look-ups, flushing both the L1 and L2 caches.

http://www.slideshare.net/hughreynolds/optimizing-lua-for-consoles-allen-murphy-microsoft

Enjoy your FFOC.

Name: Anonymous 2011-09-24 22:38




function make_value(v)
  return function() return v end,
         function(new_v) v = new_v end
end

function make_struct(...)
  local functions = {}
  for i,v in ipairs({...}) do
    getter, setter = make_value(v)
    table.insert(functions, getter)
    table.insert(functions, setter)
  end
  return unpack(functions)
end

function main()
  local get_name,   set_name,
        get_age,    set_age,
        get_gender, set_gender = make_struct('John', 34, 'male')

  print(get_name())  --> prints John
  print(get_age())   --> prints 34
  set_age(56)
  print(get_age())   --> prints 56
end

main()


>>155

WHOA WHOA WHAT NOW BRO? WHAT NOW?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List