POV-Ray : Newsgroups : povray.bugreports : Parse Error: String too long. : Re: Parse Error: String too long. Server Time
18 Apr 2024 00:35:01 EDT (-0400)
  Re: Parse Error: String too long.  
From: Warp
Date: 28 Dec 2014 18:17:46
Message: <54a08f9a@news.povray.org>
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.
Most std::string implementations nowadays use short string optimization
(although there are probably a few exceptions), so they are very
efficient for short strings, and probably what MAX_STRING_LEN_FAST
is already doing.

-- 
                                                          - Warp


Post a reply to this message

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