[Ecls-list] how to cache a cl_object in C?
yami
yamisoe at gmail.com
Sat Mar 27 07:34:09 UTC 2010
On Thu, Mar 25, 2010 at 9:50 PM, Juan Jose Garcia-Ripoll <
juanjose.garciaripoll at googlemail.com> wrote:
> On Thu, Mar 25, 2010 at 1:06 PM, yami <yamisoe at gmail.com> wrote:
>
>> Hi,
>>
>> I have following pseudo code:
>> cl_object some_object = si_safe_eval(3, c_string_to_object("(blah
>> blah)"), Cnil, OBJNULL);
>> for (i=0; i<LARGE_NUMBER; i++) {
>> cl_funcall(2, cl_intern(1,
>> make_simple_base_string("use_some_object")), some_object);
>> }
>>
>> It seems that after some iterations, the value of some_object changed...
>> Any ideas?
>>
>
> If "some_object" is in a thread that is know to ECL and it is an automatic
> (i.e. stack) C variable, the object will not change.
>
What will happen if some_object is a data member of a 'new'ed C++ class
instance? Another question, code likes following:
for (i=0; i<n; i++) {
cl_object object_from_ecl = si_safe_eval(...);
}
if object_from_ecl is cached in C, how ECL knows when to gc this object?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100327/eee19e88/attachment.html>
More information about the ecl-devel
mailing list