From: ts Date: 2004-03-08T00:46:48+09:00 Subject: Re: freeze, frozen? in extensions >>>>> "T" == Tim Hunter writes: T> Today I see that I my original post was terse to the point of being T> incomprehensible. What I was trying to ask was "How do I support the T> freeze method in my C extension? That is, suppose a script calls the T> freeze method on one of my objects, and then uses a method that modifies T> that object. What should I do?" raise an error. T> To confirm my plan I started looking at the code for the standard T> libraries that are written in C, but I saw very few calls to T> rb_check_frozen. This makes me wonder, have I misunderstood how to support T> frozen objects in C? No, but like said previously by "daz" , in many case a C extension will use the standard API function and ruby will make the test. Uf this is not the case add the test. For example, mmap has svg% grep frozen mmap-0.2.4/*.c rb_error_frozen("mmap"); \ if (t_mm->flag & MM_FROZEN) rb_error_frozen("mmap"); if (t_mm->flag & MM_FROZEN) rb_error_frozen("mmap"); rb_error_frozen("mmap"); if (str->flag & MM_FROZEN) rb_error_frozen("mmap"); svg% Guy Decoux