[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smobs
From: |
Marius Vollmer |
Subject: |
Re: smobs |
Date: |
13 May 2003 19:51:19 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
"Dr. Peter Ivanyi" <address@hidden> writes:
> For example is this correct:
>
> static scm_t_bits data_tag = 0;
>
> static SCM make_my_data(SCM scm_data)
> {
> int tt;
>
> SCM_ASSERT(SCM_INUM(scm_data), ...);
>
> tt = SCM_INUM(scm_data);
>
> SCM_RETURN_NEWSMOB(data_tag, tt);
> }
Yes, you can do that. You need to return 0 in your smob free routine
then.
[ BTW: The memory management for smobs will be much nicer in the 1.8
series of Guile. ]
> Moreover with the above example every time the function is called
> "tt" will be created on the stack. Will guile see it properly?
Since "tt" does not hold a SCM object (it is just an "int"), Guile
does not need to see it.
> Will the stack be maintained correctly? Does that mean that unless
> my integer object is released that stack is growing?
I don't understand. "tt" is a totally ordinary local C variable that
behaves like any other local C variable.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
- smobs, Dr. Peter Ivanyi, 2003/05/11
- Re: smobs, Thamer Al-Harbash, 2003/05/12
- Re: smobs, Thamer Al-Harbash, 2003/05/12
- Re: smobs, Dr. Peter Ivanyi, 2003/05/12
- Re: smobs, Thamer Al-Harbash, 2003/05/12
- Re: smobs,
Marius Vollmer <=
- Re: smobs, tomas, 2003/05/14
- Re: smobs, Dr. Peter Ivanyi, 2003/05/14