On Sat, Mai 4, 2019 at 09:09:23 UTC+2 Sam Clegg wrote:
>
> From: <[email protected] <javascript:>> 
> Date: Fri, May 3, 2019 at 1:41 AM 
> To: emscripten-discuss 
>
> > On Mon, Apr 29, 2019 at 18:23:48 UTC+2 Alon Zakai wrote: 
> > 
> >     Glad you figured this out ! Can you please open a PR with your 
> improvements? 
> > 
> > Sorry to say, but my proposals are not ready for a pull request. 
> > I proposed two possibilities to solve this issue: 
> > 
> >   1. Extend the existing implementation. 
> >   2. Switch to a C implementation. 
> > 
> > In both cases there are several questions open. 
> > 
> >  - Are the maps used by the JavaScript implementation of 
> >    getenv() and setenv() used elsewhere from JavaScript? 
> >  - The current JavaScript implementation puts the whole 
> >    environment into one block of data. Is this necessary? 
> >  - My C implementation of getenv() and setenv() does not 
> >    create the environment in one block of data. Is this 
> >    acceptable? 
> > 
> > Somebody with more knowledge about Emscripten is probably 
> > able to use my proposals to write a solution. 
> > 
> > At the end the function setenv() should NEVER trigger: 
> > 
> >   Error: Environment size exceeded TOTAL_ENV_SIZE! 
> > 
> > This is just not the way a C library function should work. 
> > 
>
> Technically according to the manpage setenv is allowed to fail with 
> out of memory: 
>
> ERRORS 
>        EINVAL name is NULL, points to a string of length 0, or 
> contains an '=' character. 
>
>        ENOMEM Insufficient memory to add a new variable to the 
> environment. 
>
> However I imagine in this case you are seeing a bug in the 
> implementation rather than actual memory exhaustion so we probably do 
> need to fix emscripten.
>

As you said, I am not seeing this as memory exhaustion.
Fixing emscripten in this regard would be really really helpful.

Emscripten works great and this problem is one of the things that
hinders my efforts to compile and run my project (Seed7) with emscripten.

Many thanks in advance for the hero, who fixes setenv().

Thomas Mertes 
 
-- 
Seed7 Homepage:  http://seed7.sourceforge.net 
Seed7 - The extensible programming language: User defined statements 
and operators, abstract data types, templates without special 
syntax, OO with interfaces and multiple dispatch, statically typed, 
interpreted or compiled, portable, runs under linux/unix/windows.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/697b17bc-f819-4726-9df9-4574aea58d51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to