From: "Mauricio Fernández" Date: 2003-03-28T17:40:29+09:00 Subject: Re: [Q] Caveats of rb_global_variable() ? On Fri, Mar 28, 2003 at 03:16:18PM +0900, Julian Snitow wrote: > Thanks. Can rb_gc_unregister_adddress() be safely called on an address > that wasn't necessarily registered in the first place? If so, I can > solve my problem neatly. You were lucky, problem solved :-) void rb_gc_unregister_address(addr) VALUE *addr; { struct gc_list *tmp = global_List; if (tmp->varptr == addr) { global_List = tmp->next; RUBY_CRITICAL(free(tmp)); return; } while (tmp->next) { if (tmp->next->varptr == addr) { struct gc_list *t = tmp->next; tmp->next = tmp->next->next; RUBY_CRITICAL(free(t)); break; } tmp = tmp->next; } } Nothing happens if it wasn't registered before. -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com * SynrG notes that the number of configuration questions to answer in sendmail is NON-TRIVIAL -- Seen on #Debian