- From: Jani Huhtanen <address@hidden>
- To: address@hidden
- Subject: Re: [TeXmacs] URGENT: Document too large?
- Date: Mon, 26 Jun 2006 19:39:29 +0300
On Monday 26 June 2006 19:12, Joris van der Hoeven wrote:
>
On Mon, Jun 26, 2006 at 06:21:40PM +0300, Jani Huhtanen wrote:
>
> I'm writing my thesis on texmacs, and now at the very last chapter of my
>
> thesis I stumbled upon a nasty bug/feature. Texmacs does not load my
>
> document anymore. Instead of loading it throws an error:
>
>
>
> -- TeXmacs] With linked TrueType support
>
> ERROR: In procedure scm_allocate_string:
>
> ERROR: Argument 1 out of range: 28213052
>
>
>
> and by staggering coincidence 28213052 (~27Mb) just so happens to be the
>
> number of bytes in my document. Please tell me that there is an easy fix
>
> to this!
>
>
>
> Until then I'll try to break the document into parts and edit those
>
> instead which is going to be fun :(
>
>
This is a problem with Guile, on which TeXmacs is based,
>
but which is not part of TeXmacs, so to say.
>
In the guile source code, I found
>
>
#define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL)
>
#define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8))
>
#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s),
>
(((long)
>
(l)) << 8) + scm_tc7_string))
>
>
This seems to indicate that 2^24 is the maximum allowed length of
>
a string (about 16Mb). Of course, this is ridiculous.
>
If you are on a 64 bit architecture, then you may check whether
>
the following works (recompile Guile and TeXmacs):
>
>
#define SCM_STRING_MAX_LENGTH ((1UL << 56) - 1UL)
>
#define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8))
>
#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s),
>
(((long)
>
(l)) << 8) + scm_tc7_string))
>
>
If that is so, then you are done. This would leave us with the question
>
whether the scm_tc7_string really needs to be 8 bits long,
>
or whether its size could be decreased to, say, 4 bits.
>
>
Best wishes, Joris
I'm not on a 64 bit platform unfortunately. So if I understand this correctly
TeXmacs stores the documents into a single string. Which is bad for guile
because guile cannot represent the length of over 16Mb string. Would it be
possible/easy to store the document in several smaller strings? Perhaps
one 'part' in a one string.
Other problem which has been partially resolved by working on a one 'part' at
a time, is that when the text becomes large, editing starts to lag. By lag I
mean several second freeze up. I don't think it is caused by the autosave
saving on a background because the lag occurs more frequent that autosave
should save.
--
Jani Huhtanen
TTY Porin yksikkö
address@hidden
Archive powered by MHonArc 2.6.19.