Hello, Just getting back to parrot. [Leo]* alloca() isn't portable and not available everywhere [Dan] Yep. This is a gcc-ism. Use Parrot's memory allocation functions instead.
reg_alloc.c uses malloc(). I saw alloca() used in the CVS tree earlier, but it's gone now. What is the correct way to allocate memory in Parrot? [Leo]* the Dbg and Dbg2 debug macros aren't needed. Just use the existing debug(interp, level, ...) function in src/debug.c. If you need some extra levels, you can use some more bits in imcc/debug.h I notice an IMC_TRACE macro, as well as the associated debug stuff. Debug looks like it has a lot of overhead, even when turned off. I didn't really get Dbg cleaned up either, because I couldn't figure out how to handle variable number of arguments, but something like assert() would be much nicer. I'll go ahead and follow the convention of adding debug calls. Should the IMC_TRACE stuff be removed? [Leo] * all functions should have an Interp* and a IMC_Unit* argument to allow [Leo] reentrancy. I.e. all state should be in the unit structure. I'm not quite sure I understand this. I get that each function call has (interpreter,unit) as parameters. But why is this? Parrot handles interrupts, I understand, so this probably has something to do with interrupt processing. Does this also mean that there should be no other data structures, except those pointed to by interpreter or unit? [Dan] I'd like the code issues cleaned up before it gets committed. I want to fix the memory leak, which involves rewriting a few functions. This might go fast, or it could become difficult. It's probably best to send an intermediate patch that has the code issues fixed. That way we can maximize code review, and make sure I'm writing parrot compliant code. - Bill
