[Monetdb-developers] MonetDB: Oct2010 - When you have MAL plans with 500k lines of co...

Romulo Goncalves R.A.Goncalves at cwi.nl
Wed Sep 15 16:03:49 CEST 2010

I fixed the alloca problem, but I am wondering if the newStack function is correct.

On 15/09/10 15:56, Romulo Goncalves wrote:
> Changeset: 2727702e548b for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2727702e548b
> Modified Files:
> 	MonetDB5/src/mal/mal_interpreter.mx
> 	MonetDB5/src/mal/mal_stack.mx
> Branch: Oct2010
> Log Message:
> When you have MAL plans with 500k lines of code mserver crashes at the memset after newStack.
> This function is only called in one place and followed by a memset. Therefore, the alloca + memset
> can be replaced by a zalloc.
> The structure is free in the end of the function call before the return.
> diffs (32 lines):
>   #define stackSize(CNT) (sizeof(ValRecord)*(CNT) + sizeof(MalStack))
> -#define newStack(S,CNT) S= (MalStkPtr) alloca(stackSize(CNT));\
> +#define newStack(S,CNT) S= (MalStkPtr) GDKzalloc(stackSize(CNT));\
>   		(S)->stksize=CNT;

I do not know the context, but shouldn't the stack size be stackSize(CNT) instead of CNT?

> _______________________________________________
> Checkin-list mailing list
> Checkin-list at monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list

More information about the developers-list mailing list