Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19212
Modified Files: Tag: desiredata desire.c kernel.c Log Message: removed queue_nevermind and manager_nevermind; added scheduled deletes
Index: kernel.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v retrieving revision 1.1.2.40 retrieving revision 1.1.2.41 diff -C2 -d -r1.1.2.40 -r1.1.2.41 *** kernel.c 15 Jan 2007 23:12:01 -0000 1.1.2.40 --- kernel.c 15 Jan 2007 23:56:18 -0000 1.1.2.41 *************** *** 292,295 **** --- 292,297 ---- }
+ /* in which the value has bit 0 set if the key object is not a zombie, + and has bit 1 set if the object has been uploaded to the client */ t_hash *object_table;
*************** *** 307,314 **** }
! extern "C" void pd_free_zombie(t_pd *x) { t_class *c = x->_class; if (c->gobj) appendix_free((t_gobj *)x); if (c->size) free(x); }
--- 309,317 ---- }
! void pd_free_zombie(t_pd *x) { t_class *c = x->_class; if (c->gobj) appendix_free((t_gobj *)x); if (c->size) free(x); + hash_delete(object_table,x); }
*************** *** 323,327 **** } /* schedule for deletion if need to keep the allocation around */ ! if (c->gobj && 0 /*is in the client*/) hash_set(object_table,x,0); else pd_free_zombie(x); }
--- 326,332 ---- } /* schedule for deletion if need to keep the allocation around */ ! if (c->gobj && (long)hash_get(object_table,x)|2) { ! hash_set(object_table,x,(void *)((long)hash_get(object_table,x)&~1)); ! } else pd_free_zombie(x); }
*************** *** 1991,1996 **** /* LATER remove the dependence on the current canvas for $0; should be another argument. */ ! t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew) ! { char buf[MAXPDSTRING]; char buf2[MAXPDSTRING]; --- 1996,2000 ---- /* LATER remove the dependence on the current canvas for $0; should be another argument. */ ! t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew) { char buf[MAXPDSTRING]; char buf2[MAXPDSTRING]; *************** *** 2011,2023 **** str=substr+1; while((next=binbuf_expanddollsym(str, buf, dollarnull, ac, av, tonew))>=0) { ! /* ! * JMZ: i am not sure what this means, so i might have broken it ! * it seems like that if "tonew" is set and the $arg cannot be expanded (or the dollarsym is in reality a A_DOLLAR) ! * 0 is returned from binbuf_realizedollsym ! * this happens, when expanding in a message-box, but does not happen when the A_DOLLSYM is the name of a subpatch ! */ ! if(!tonew&&(0==next)&&(0==*buf)) { ! return 0; /* JMZ: this should mimick the original behaviour */ ! } strncat(buf2, buf, MAXPDSTRING/2-1); str+=next; --- 2015,2024 ---- str=substr+1; while((next=binbuf_expanddollsym(str, buf, dollarnull, ac, av, tonew))>=0) { ! /* JMZ: i am not sure what this means, so i might have broken it. it seems like that if "tonew" is ! set and the $arg cannot be expanded (or the dollarsym is in reality a A_DOLLAR). ! 0 is returned from binbuf_realizedollsym; this happens when expanding in a message-box, ! but does not happen when the A_DOLLSYM is the name of a subpatch */ ! /* JMZ: this should mimick the original behaviour */ ! if(!tonew && !next && !*buf) return 0; strncat(buf2, buf, MAXPDSTRING/2-1); str+=next; *************** *** 2034,2039 **** }
- extern t_hash *object_table; - void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv) { static t_atom mstack[MSTACKSIZE], *msp = mstack, *ems = mstack+MSTACKSIZE; --- 2035,2038 ---- *************** *** 2051,2058 **** if (at->a_w.w_index <= 0 || at->a_w.w_index > argc) { error("$%d: not enough arguments supplied", at->a_w.w_index); ! goto cleanup; } else if (argv[at->a_w.w_index-1].a_type != A_SYMBOL) { error("$%d: symbol needed as message destination", at->a_w.w_index); ! goto cleanup; } else s = argv[at->a_w.w_index-1].a_symbol; } else if (at->a_type == A_DOLLSYM) { --- 2050,2057 ---- if (at->a_w.w_index <= 0 || at->a_w.w_index > argc) { error("$%d: not enough arguments supplied", at->a_w.w_index); ! goto cleanup; } else if (argv[at->a_w.w_index-1].a_type != A_SYMBOL) { error("$%d: symbol needed as message destination", at->a_w.w_index); ! goto cleanup; } else s = argv[at->a_w.w_index-1].a_symbol; } else if (at->a_type == A_DOLLSYM) {
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.131 retrieving revision 1.1.2.217.2.132 diff -C2 -d -r1.1.2.217.2.131 -r1.1.2.217.2.132 *** desire.c 15 Jan 2007 23:38:03 -0000 1.1.2.217.2.131 --- desire.c 15 Jan 2007 23:56:16 -0000 1.1.2.217.2.132 *************** *** 128,133 **** }
- void manager_nevermind (t_gobj *victim); - void appendix_free (t_gobj *master) { t_appendix *self = master->dix; --- 128,131 ---- *************** *** 138,142 **** hash_free(self->visual); } - manager_nevermind(master); free(self); } --- 136,139 ---- *************** *** 252,265 **** for (int i=self->start; i!=(self->start+self->len)%QUEUE_SIZE; i=(i+1)%QUEUE_SIZE)
- /* suicide letter from a t_gobj who was the originator of a notice */ - void queue_nevermind (t_queue *self, t_gobj *victim) { - queue_each(i,self) { - if (self->o[i]==victim) { - self->o[i]=0; - printf("cancelled update_object for %p\n",victim); - } - } - } - void queue_free (t_queue *self) { abort(); --- 249,252 ---- *************** *** 351,356 **** }
- void manager_nevermind (t_gobj *victim) {queue_nevermind(manager->q,victim);} - extern "C" void manager_anything (t_manager *self, t_symbol *s, int argc, t_atom *argv) { binbuf_clear(self->b); --- 338,341 ---- *************** *** 6369,6372 **** --- 6354,6362 ----
void pd_upload(t_gobj *self) { + if (!(long)hash_get(object_table,self)&1) { + sys_mgui(self,"delete",""); + pd_free_zombie(self); + return; + } t_binbuf *b = binbuf_new(); t_class *c = self->_class;