|
nielsm posted:Yeah, the runtime library might very well have thread-local random generator seeds. By the way, MSVC's random number generator seeds are in thread-local storage; just an FYI.
|
# ¿ May 4, 2011 00:02 |
|
|
# ¿ Mar 29, 2024 09:23 |
|
Gordon Cole posted:I've got a homework assignment that's driving me nuts. I'm implementing a compiler for a custom language that translates to C. This language supports nested functions that can reference variables in their parent functions. From what I understand, the best way to implement this is to pass a static link (a pointer to the stack frame of the enclosing function) to each function, from which you can find the variable you want by applying a constant offset. Just figure out which variables from the parent function are being used in the nested function and pass references/pointers to all of them when calling the nested function.
|
# ¿ May 6, 2011 14:52 |