Blog

  • Valve Boss Needs Shave, Haircut and Bath

    gabe Newell needs a haircut a shave and a bath …

  • Should I revert “real” references?

    I can’t see any point when you can use pointers. Is there any use case for them? In case you aren’t aware, the last change I made to BooBoo had references that you could take the address of and get the address of the variable passed as a reference… C++ doesn’t have these kind of references and there is a significant overhead when doing it. So I want to remove them unless there is a reason I don’t think of. Anyone?

    Update: Now it’s done (2.4.4.) The address operator (@) remains but references aren’t such a CPU pig again. Reference values are copied back into the appropriate place after the function ends instead of rewriting variables to refer directly to the original value, since there doesn’t seem to be any value in it when pointers are available.

    The @ operator is shorthand, which can be used to easily pass pointer values into a function. Instead of:

    pointer p
    address p var
    call foobar p

    You can do:

    call foobar (@ var)

    You could replace use of address with @ if you want:

    = my_pointer (@ var)