guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] test for smob mark segv


From: Ludovic Courtès
Subject: Re: [PATCH] test for smob mark segv
Date: Fri, 01 Mar 2013 10:37:45 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hi Mike,

Mike Gran <address@hidden> skribis:

> It is a standalone test that, in effect, checks to see if
> BDW-GC is running marking in its own non-Guile thread.  If
> BDW does have parallel marking enabled, this test will SEGV.
> If it doesn't have parallel marking enabled, this test will pass.

Good.

FWIW, I’ve been meaning to fix the problem for good.  I hope to post a
patch within the next few days.

> From f3adf180edbf6ebe642cf4c1ad8f029ce0876d0d Mon Sep 17 00:00:00 2001
> From: Mike Gran <address@hidden>
> Date: Tue, 26 Feb 2013 08:27:22 -0800
> Subject: [PATCH] Add standalone test for smob marking
>
> * test-suite/standalone/Makefile.am: add test-smob-mark

Specify the makefile variable name in parentheses.

> * test-suite/standalone/test-smob-mark.c: new test
> * test-suite/standalone/.gitignore: ignore test-smob-mark

No need for .gitignore here.

> +typedef struct x_tag
> +{
> +  SCM scm_value;
> +  int c_value;
> +} x_t;

Separate typedef and struct.

> +static scm_t_bits x_tag;
> +SCM make_x (void);
> +SCM mark_x (SCM x);
> +int print_x (SCM x, SCM port, scm_print_state * pstate);
> +size_t free_x (SCM x);
> +void init_smob_type (void);
> +void test_scm_smob_mark (void);

Make them all static.

> +SCM
> +mark_x (SCM x)
> +{
> +  x_t *c_x;
> +  c_x = (x_t *) SCM_SMOB_DATA (x);
> +  scm_gc_mark (c_x->scm_value);
> +  return SCM_BOOL_F;
> +}

I think it’d be good to increment a global counter to make sure the mark
procedure is called at all.

Thanks!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]