Is there a 77 KB limit on PluaApp PRC files from plua2c.exe?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a 77 KB limit on PluaApp PRC files from plua2c.exe?

ZzHatD
It seems as though I can run a 88KB LUA file from the plua-2.0b10
device environment, but I cannot compile it on the device or on the
desktop.  On the desktop it errors or fails to generate the PRC at
approximately 77 KB of PRC.  I am now using -s to strip debugging,
which helped increase the amount of code I could compile, but still my
application is larger that what I can successfully compile.  Is this a
defect in plua2c?  Are there any work-arounds?  Any suggestions?

Reply | Threaded
Open this post in threaded view
|

Re: Is there a 77 KB limit on PluaApp PRC files from plua2c.exe?

migueletto-2
--- In [hidden email], "pluaprogrammer" <pluaprogrammer@...> wrote:
>
> It seems as though I can run a 88KB LUA file from the plua-2.0b10
> device environment, but I cannot compile it on the device or on the
> desktop.  On the desktop it errors or fails to generate the PRC at
> approximately 77 KB of PRC.  I am now using -s to strip debugging,
> which helped increase the amount of code I could compile, but still my
> application is larger that what I can successfully compile.  Is this a
> defect in plua2c?  Are there any work-arounds?  Any suggestions?
>

Without the error messages is difficult to tell what is going on. But
I suspect you have reached a PalmOS limit. A compiled Plua app has
many records, one of them beeing the compiled Lua bytecode. Just like
any database/resource record in PalmOS, it cannot exceed 64 KB.

It is also not clear how you store the 88KB Lua source file, but I
assume it is a stream or VFS file. Streams are automatically
partitioned in 64KB chunks and VFS files do not have records at all,
so they do not suffer from the 64KB limit. But when you compile them
the resulting bytecode must fit in a 64KB record.

Regarding options, you could break up your app in smaller modules,
each one in a separate PRC, and load them from your main module.

Regards,
Marcio.

Reply | Threaded
Open this post in threaded view
|

Re: Is there a 77 KB limit on PluaApp PRC files from plua2c.exe?

ZzHatD
--- In [hidden email], "migueletto" <migueletto@...> wrote:
>
> --- In [hidden email], "pluaprogrammer" <pluaprogrammer@>
wrote:
> >
> > It seems as though I can run a 88KB LUA file from the plua-2.0b10
> > device environment, but I cannot compile it on the device or on
the
> > desktop.  On the desktop it errors or fails to generate the PRC
at
> > approximately 77 KB of PRC.  I am now using -s to strip
debugging,
> > which helped increase the amount of code I could compile, but
still my
> > application is larger that what I can successfully compile.  Is
this a
> > defect in plua2c?  Are there any work-arounds?  Any suggestions?
> >
>
> Without the error messages is difficult to tell what is going on.
But
> I suspect you have reached a PalmOS limit. A compiled Plua app has
> many records, one of them beeing the compiled Lua bytecode. Just
like

> any database/resource record in PalmOS, it cannot exceed 64 KB.
>
> It is also not clear how you store the 88KB Lua source file, but I
> assume it is a stream or VFS file. Streams are automatically
> partitioned in 64KB chunks and VFS files do not have records at all,
> so they do not suffer from the 64KB limit. But when you compile them
> the resulting bytecode must fit in a 64KB record.
>
> Regarding options, you could break up your app in smaller modules,
> each one in a separate PRC, and load them from your main module.
>
> Regards,
> Marcio.
>
- It is a VFS file, so it matches your described behavior.
- I suspect the 64KB limit is the problem, just as you proposed.
- I would like my users to have as few files to install as possible,
so I will try to condense and eliminate features until I am under the
64KB mark.
- Just so you know, in this case, it doesn't seem to show any errors
in the console.  It just doesn't generate the PRC.

1.) Since I am compiling close to the memory limit, I wonder about
the memory available to the app during run time.  Am I correct that
the code and variables sit in different memory spaces?

2.) I am experiencing a problem with event triggers (especially
buttons).  They work for a while and then suddenly seem to stop
firing events.  I converted one whole dialog filled with buttons to
hyper-areas (pen events) to try and avoid the problem, but it is
still occuring on other dialogs with only a few buttons.  Will this
happen after I successfully compile too?  In other words, is this a
problem only with the interpretive (style) PLUA2 environment, or both
that and the compiled PLUA2RT environment?

Reply | Threaded
Open this post in threaded view
|

Re: Is there a 77 KB limit on PluaApp PRC files from plua2c.exe?

migueletto-2
--- In [hidden email], "pluaprogrammer" <pluaprogrammer@...> wrote:

> 1.) Since I am compiling close to the memory limit, I wonder about
> the memory available to the app during run time.  Am I correct that
> the code and variables sit in different memory spaces?

When inside a PRC, compiled Plua code must fit in 64KB. When the app
is loaded by the runtime, everything (code and variables) is loaded in
 the PalmOS dynamic heap. The size of this heap varies between models.

> 2.) I am experiencing a problem with event triggers (especially
> buttons).  They work for a while and then suddenly seem to stop
> firing events.  I converted one whole dialog filled with buttons to
> hyper-areas (pen events) to try and avoid the problem, but it is
> still occuring on other dialogs with only a few buttons.  Will this
> happen after I successfully compile too?  In other words, is this a
> problem only with the interpretive (style) PLUA2 environment, or both
> that and the compiled PLUA2RT environment?

I do not know. I have not seen this problem before.

Regards,
Marcio.