[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/src header_info.c usiblender.c

Toni Alatalo antont at kyperjokki.fi
Tue May 30 14:30:27 CEST 2006


On Tuesday 30 May 2006 15:22, Ton Roosendaal wrote:
> I meant *maximum* space for strings... that's the whole problem you
> know!

(and here a c-ignorant coder wonders why strings must have a defined max 
length .. is it because how malloc / sdna / something works - i thought they 
could just end to \n when they feel like it?, but guess that something needs 
to know the size

this seems to work ok in python: 
In [58]: longstr = 'I am a long string - ' * 1000000
In [59]: len(longstr)
Out[59]: 21000000

but that is of course irrelevant and you can just happily ignore me :)

> -Ton-

~Toni

>
> On 30 May, 2006, at 13:38, Jiří Hnídek wrote:
> > Hi Ton,
> > why need I store length of string? I can use function strlen(string),
> > can't I. What should do generic string manipulation library? I guess,
> > I could write one.
> >
> > Jiri
> >
> > Ton Roosendaal wrote:
> >> Hi,
> >>
> >>> I'm just rewriting recent open as ListBase and I would like to
> >>> replace sce[160], lib[160], ima[160] with pointers at char in the
> >>> future too.
> >>
> >> A nice generic string manipulation lib would help too :)
> >> Using our secured malloc, any malloc can always be verified to return
> >> the data allocation size, with this call;
> >> MEM_allocN_len();
> >> So you don't need to store string lengths.
> >> -Ton-
> >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at projects.blender.org
> > http://projects.blender.org/mailman/listinfo/bf-committers
>
> ------------------------------------------------------------------------
> --
> Ton Roosendaal  Blender Foundation ton at blender.org
> http://www.blender.org
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list