POV-Ray : Newsgroups : povray.bugreports : Parse Error: String too long. : Re: Parse Error: String too long. Server Time
25 Apr 2024 03:48:45 EDT (-0400)
  Re: Parse Error: String too long.  
From: Thorsten Froehlich
Date: 29 Dec 2014 07:35:00
Message: <web.54a149cbf7cf417b6c268070@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Le_Forgeron <jgr### [at] freefr> wrote:
> > Btw, there is, in current main branch, an array sized by
> > MAX_STRING_LEN_FAST, so this increase to 65536 is not a good idea at
> > all. And limiting fast string to 256 is really what is intended (fast
> > string is used for token, you do not want to type a 10235 charaters long
> > identifier anyway). It's just the slower string that must be unbounded.
> > (as long as your C++ memory allows it)
>
> If MAX_STRING_LEN_FAST is used for an array, then it's indeed not a
> very good idea to set it to 65536 because it would mean that even
> single-character strings would start consuming that much RAM.

> Using std::string for all strings is probably a very viable option.

The place where it is used is the core part of the tokenizer. Using a
dynamically allocated string would significantly increase overhead in the most
called place as the short string optimization won't work (it is frequently not
more than 10/14 chars). Now consider the average POV token length, and you
notice
you get at least one additional memory allocation per token parsed.

The only limit is that this can't parse character strings over 256 chars long.
However, as you can concat strings to any length in POV, this is neither a bug
now something that needs to be fixed. To the contrary...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.