Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25549
Modified Files: Tag: devel_0_38 m_binbuf.c m_class.c m_imp.h m_memory.c Log Message: devel_0_38
Index: m_class.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_class.c,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** m_class.c 6 Sep 2004 20:20:35 -0000 1.3 --- m_class.c 5 Nov 2004 13:57:56 -0000 1.3.4.1 *************** *** 210,213 **** --- 210,214 ---- c->c_pwb = 0; c->c_firstin = ((flags & CLASS_NOINLET) == 0); + c->c_firsttip = gensym("?"); c->c_patchable = (typeflag == CLASS_PATCHABLE); c->c_gobj = (typeflag >= CLASS_GOBJ); *************** *** 830,831 **** --- 831,838 ---- return(0); } + + + void class_settip(t_class *x,t_symbol* s) + { + x->c_firsttip = s; + }
Index: m_binbuf.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_binbuf.c,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** m_binbuf.c 6 Sep 2004 20:20:35 -0000 1.4 --- m_binbuf.c 5 Nov 2004 13:57:56 -0000 1.4.4.1 *************** *** 67,70 **** --- 67,75 ---- t_atom *ap; int nalloc = 16, natom = 0; + + #ifdef GG_ESCAPE_HACK + int escape = 0; /* GG: escape mechanism */ + #endif + t_freebytes(x->b_vec, x->b_n * sizeof(*x->b_vec)); x->b_vec = t_getbytes(nalloc * sizeof(*x->b_vec)); *************** *** 77,80 **** --- 82,92 ---- while ((textp != etext) && (*textp == ' ' || *textp == '\n' || *textp == '\r' || *textp == '\t')) textp++; + + #ifdef GG_ESCAPE_HACK + /* GG: escape mechanism */ + if (*textp == '"') escape = !escape,textp++; + while ((textp != etext) && !escape && (*textp == ' ' || *textp == '\n' || *textp == '\r' || *textp == '\t')) + textp++; + #endif if (textp == etext) break; if (*textp == ';') SETSEMI(ap), textp++; *************** *** 154,158 **** while (textp != etext && bufp != ebuf && (slash || (*textp != ' ' && *textp != '\n' && *textp != '\r' ! && *textp != '\t' &&*textp != ',' && *textp != ';'))); *bufp = 0; #if 0 --- 166,174 ---- while (textp != etext && bufp != ebuf && (slash || (*textp != ' ' && *textp != '\n' && *textp != '\r' ! && *textp != '\t' &&*textp != ',' && *textp != ';' ! #ifdef GG_ESCAPE_HACK ! && *textp != '"') || (escape && (*textp != '"') /* GG: */ ! #endif ! ))); *bufp = 0; #if 0 *************** *** 421,424 **** --- 437,442 ---- int canvas_getdollarzero( void);
+ /* 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) {
Index: m_memory.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_memory.c,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** m_memory.c 6 Sep 2004 20:20:35 -0000 1.2 --- m_memory.c 5 Nov 2004 13:57:56 -0000 1.2.4.1 *************** *** 8,11 **** --- 8,23 ---- #include "m_imp.h"
+ /* T.Grill - include SIMD functionality */ + #include "m_simd.h" + + /* T.Grill - bit alignment for signal vectors (must be a multiple of 8!) */ + /* if undefined no alignment occurs */ + #ifdef SIMD_BYTEALIGN + #define VECTORALIGNMENT (SIMD_BYTEALIGN*8) + #else + #define VECTORALIGNMENT 128 + #endif + + /* #define LOUD */ #ifdef LOUD *************** *** 80,83 **** --- 92,163 ---- }
+ /* in the following size_t is assumed to have the same size as a pointer type !!! */ + + /* T.Grill - get aligned memory */ + void *getalignedbytes(size_t nbytes) + { + /* to align the region we also need some extra memory to save the original pointer location + it is saved immediately before the aligned vector memory + */ + void *vec = getbytes(nbytes+ (VECTORALIGNMENT/8-1)+sizeof(void *)); + + #ifdef LOUD + fprintf(stderr, "getaligned %p %d\n",vec, nbytes); + #endif /* LOUD */ + + if (vec != NULL) + { + /* get alignment of first possible signal vector byte */ + t_int alignment = ((t_int)vec+sizeof(void *))&(VECTORALIGNMENT/8-1); + /* calculate aligned pointer */ + void *ret = (unsigned char *)vec+sizeof(void *)+(alignment == 0?0:VECTORALIGNMENT/8-alignment); + /* save original memory location */ + *(void **)((unsigned char *)ret-sizeof(void *)) = vec; + return ret; + } + else + return 0; + + } + + /* T.Grill - free aligned vector memory */ + void freealignedbytes(void *ptr,size_t nbytes) + { + /* get original memory location */ + void *ori = *(void **)((unsigned char *)ptr-sizeof(void *)); + + #ifdef LOUD + fprintf(stderr, "freealigned %p %p %d\n",ptr, ori, nbytes); + #endif /* LOUD */ + freebytes(ori,nbytes+(VECTORALIGNMENT/8-1)+sizeof(void *)); + } + + /* T.Grill - resize aligned vector memory */ + void *resizealignedbytes(void *ptr,size_t oldsize, size_t newsize) + { + /* get original memory location */ + void *ori = *(void **)((unsigned char *)ptr-sizeof(void *)); + void *vec = resizebytes(ori,oldsize+(VECTORALIGNMENT/8-1)+sizeof(void *), + newsize+ (VECTORALIGNMENT/8-1)+sizeof(void *)); + /* get alignment of first possible signal vector byte */ + t_int alignment = ((t_int)vec+sizeof(void *))&(VECTORALIGNMENT/8-1); + /* calculate aligned pointer */ + void *ret = (unsigned char *)vec+sizeof(void *)+ + (alignment == 0?0:VECTORALIGNMENT/8-alignment); + /* save original memory location */ + *(void **)((unsigned char *)ret-sizeof(void *)) = vec; + return ret; + } + + /* TB: copy to aligned vector memory */ + void *copyalignedbytes(void *src, size_t nbytes) + { + void *ret; + ret = getalignedbytes(nbytes); + if (nbytes) + memcpy(ret, src, nbytes); + return (ret); + } + #ifdef DEBUGMEM #include <stdio.h>
Index: m_imp.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_imp.h,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** m_imp.h 6 Sep 2004 20:20:35 -0000 1.3 --- m_imp.h 5 Nov 2004 13:57:56 -0000 1.3.4.1 *************** *** 53,56 **** --- 53,57 ---- char c_firstin; /* if patchable, true if draw first inlet */ char c_drawcommand; /* a drawing command for a template */ + t_symbol* c_firsttip; };