morita
morit****@razil*****
2008年 11月 7日 (金) 02:15:57 JST
森です。
ご指摘ありがとうございます!
ぜひ取り込ませていただきます。
Kouhei Sutou さんは書きました:
> 須藤です。
>
> sen_ctxの初期化のところなのですが、sen_ctxのmallocまわりの初
> 期化の前にメモリ割り当て処理を行ってしまうと落ちてしまいます。
> なので、できるだけ早くmallocまわりは初期化した方がよいのでは
> ないかなぁと思います。
>
> Index: lib/ctx.c
> ===================================================================
> --- lib/ctx.c (revision 1214)
> +++ lib/ctx.c (working copy)
> @@ -169,6 +169,9 @@
> ctx->impl = NULL;
> return;
> }
> +#ifdef USE_DYNAMIC_MALLOC_CHANGE
> + sen_ctx_impl_init_malloc(ctx);
> +#endif
> if (!(ctx->impl->tables = sen_array_create(ctx, NULL, sizeof(sen_obj *),
> SEN_ARRAY_TINY))) {
> sen_io_anon_unmap(ctx, &ctx->impl->mi, sizeof(sen_io_mapinfo) * N_SEGMENTS);
> @@ -179,9 +182,6 @@
> ctx->impl->encoding = ctx->encoding;
> ctx->impl->lifoseg = -1;
> ctx->impl->currseg = -1;
> -#ifdef USE_DYNAMIC_MALLOC_CHANGE
> - sen_ctx_impl_init_malloc(ctx);
> -#endif
> ctx->impl->db = NULL;
> ctx->impl->phs = NIL;
> ctx->impl->code = NIL;
>
> _______________________________________________
> Senna-dev mailing list
> Senna****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/senna-dev
> バグ報告方法:http://qwik.jp/senna/bug_report.html
>