Update of /cvsroot/pure-data/externals/gridflow/bridge In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18883
Modified Files: placebo.rb puredata.c puredata.rb Log Message: 0.8.1
Index: puredata.c =================================================================== RCS file: /cvsroot/pure-data/externals/gridflow/bridge/puredata.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** puredata.c 4 Oct 2005 02:02:13 -0000 1.1 --- puredata.c 15 Mar 2006 04:38:20 -0000 1.2 *************** *** 44,47 **** --- 44,50 ---- #include "g_canvas.h"
+ #define CObject_free CObject_freeee + #define gfpost post + /* **************************************************************** */ struct BFObject; *************** *** 62,70 **** static BuiltinSymbols *syms;
! void CObject_freeee (void *victim) { CObject *self = (CObject *)victim; self->check_magic(); if (!self->rself) { ! fprintf(stderr,"attempt to free object that has no rself\n"); abort(); } --- 65,73 ---- static BuiltinSymbols *syms;
! void CObject_free (void *victim) { CObject *self = (CObject *)victim; self->check_magic(); if (!self->rself) { ! L fprintf(stderr,"attempt to free object that has no rself\n"); abort(); } *************** *** 82,86 **** struct Pointer : CObject { void *p; ! Pointer() { assert(!"DYING HORRIBLY"); } Pointer(void *_p) : p(_p) {} \decl Ruby ptr (); --- 85,89 ---- struct Pointer : CObject { void *p; ! Pointer() { assert(!"DYING HORRIBLY (GASP)"); } Pointer(void *_p) : p(_p) {} \decl Ruby ptr (); *************** *** 95,99 **** \end class Pointer Ruby Pointer_s_new (void *ptr) { ! return Data_Wrap_Struct(EVAL("GridFlow::Pointer"), 0, 0, new Pointer(ptr)); } void *Pointer_get (Ruby rself) { --- 98,105 ---- \end class Pointer Ruby Pointer_s_new (void *ptr) { ! Pointer *self = new Pointer(ptr); ! Ruby rself = Data_Wrap_Struct(EVAL("GridFlow::Pointer"), 0, CObject_free, self); ! self->rself = rself; ! return rself; } void *Pointer_get (Ruby rself) { *************** *** 130,145 **** extern "C" void Init_stack(VALUE *addr); static VALUE *localize_sysstack () { ! long bp; ! sscanf(RUBY_STACK_END,"0x%08lx",&bp); ! //fprintf(stderr,"old RUBY_STACK_END = %08lx\n",bp); // HACK (2004.08.29: alx has a problem; i hope it doesn't get worse) ! // this rounds to the last word of a 4k block ! // cross fingers that no other OS does it too different ! // !@#$ doesn't use STACK_GROW_DIRECTION ! // bp=((bp+0xfff)&~0xfff)-sizeof(void*); ! // GAAAH ! bp=((bp+0xffff)&~0xffff)-sizeof(void*); ! //fprintf(stderr,"new RUBY_STACK_END = %08lx\n",bp); ! return (VALUE *)bp; }
--- 136,146 ---- extern "C" void Init_stack(VALUE *addr); static VALUE *localize_sysstack () { ! long bp0,bp1; ! sscanf(STACK_END,"0x%08lx",&bp0); // HACK (2004.08.29: alx has a problem; i hope it doesn't get worse) ! // this rounds to the last word of a 64k block (bug: doesn't use STACK_GROW_DIRECTION) ! bp1=((bp0+0xffff)&~0xffff)-sizeof(void*); ! fprintf(stderr,"STACK_END old=0x%08lx; new=0x%08lx\n",bp0,bp1); ! return (VALUE *)bp1; }
*************** *** 313,317 **** rb_funcall(fm->self->rself,SI(delete),0); } else { ! post("BFObject_delete is NOT handling BROKEN object at %08x",(int)fm); } } --- 314,318 ---- rb_funcall(fm->self->rself,SI(delete),0); } else { ! post("BFObject_delete is NOT handling BROKEN object at %*lx",2*sizeof(long),(long)fm); } } *************** *** 653,657 **** void Clock_fn (Ruby rself) { rb_funcall_myrescue(rself,SI(call),0); } void Clock_mark (Clock *self) { rb_gc_mark(self->owner); } ! void Clock_free (Clock *self) { clock_free(self->serf); CObject_freeee(self); }
Ruby Clock_s_new (Ruby qlass, Ruby owner) { --- 654,658 ---- void Clock_fn (Ruby rself) { rb_funcall_myrescue(rself,SI(call),0); } void Clock_mark (Clock *self) { rb_gc_mark(self->owner); } ! void Clock_free (Clock *self) { clock_free(self->serf); CObject_free(self); }
Ruby Clock_s_new (Ruby qlass, Ruby owner) {
Index: placebo.rb =================================================================== RCS file: /cvsroot/pure-data/externals/gridflow/bridge/placebo.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** placebo.rb 4 Oct 2005 02:02:13 -0000 1.1 --- placebo.rb 15 Mar 2006 04:38:20 -0000 1.2 *************** *** 24,28 **** class Object def self.dummy(sel) ! self.module_eval "def #{sel}(*args) GridFlow.post "dummy #{sel}: %s", args.inspect end" end end --- 24,30 ---- class Object def self.dummy(sel) ! self.module_eval "def #{sel}(*args) ! #GridFlow.post "dummy #{sel}: %s", args.inspect ! end" end end *************** *** 37,40 **** --- 39,43 ---- def initialize(victim) @victim=victim end dummy :delay + dummy :unset end class Pointer