[PD-dev] string external & usage count

joerg piringer joerg at piringer.net
Wed Oct 13 16:43:36 CEST 2004


i don't want to use pointers because if i send an invalid pointer to one 
of my string objects it will most likely crash pd.
therefore i use handles. the worst thing that can happen is that a wrong 
handle refers to the wrong string. i made tests with wrong handles and 
it is quite fail safe.

i also don't want to use lists because my string class is based on 
cstring (because it shares code with a "text-processor" program i am 
writing for my pda) and so i'd have to do a lot of converting between 
list and string and back again just to do one operation. that cannot be 
effective.
i also don't know how pd handles lists, does it copy a list when i 
connect two objects to one outlet? or reference counting?

best
	joerg

Tim Blechmann wrote:
>>what i am now doing is using string handles (int) and store the
>>strings 
> 
> pd doesn't have a buildin int type ... just a suggestion, but what about
> (ab)using the pointer typecasted to floats or the pointer in t_symbol
> ...
> 
> cheers ... t
> 


-- 
http://joerg.piringer.net
http://www.transacoustic-research.com
http://www.iftaf.org
http://www.vegetableorchester.org




More information about the Pd-dev mailing list