Commit graph

12 commits

Author SHA1 Message Date
cinap_lenrek 60adc40118 devenv: allow environment total size of up to 1MB
Sometimes, there is the one-off occation when one needs to
pass a huge list in rc...

This change makes devenv track total memory consumption
of environment groups allowing them to grow up to 1MB in
size (including overhead).

(Before, only the variable size was restricted, but
not the amount of files being created).

The maximum value size of a single environment variable
is set to half of the total size, which allows the
occational large value. (But not many of them).

Because we track all memory consuption, it is also
now possible to create around 10k small environment
variales.

A hashtable is added for name lookups and the qid.path
was changed to allow direct indexing into the entry
array without needing a scan lookup.

All smalloc() calls have been removed, exhaustion is
handled with error(Enomem) avoiding deadlock
in case we run out of kernel memory.
2022-01-23 21:33:58 +00:00
cinap_lenrek a2623fd82a devenv: make #ec files not show up as world writable 2018-06-03 23:30:05 +02:00
cinap_lenrek 98363cb272 devenv: fix ORCLOSE handling
when opening a /env file ORCLOSE, and the process exits, envgrp() would
return nil can crash in envremove() because procexit will have set up->egrp
to nil before calling closefgrp().

the solution is to capture the environment on open, keeping a reference in
Chan.aux, so it doesnt matter on what process the close happens and a
env chan will always refer to its original environment group.
2015-11-22 02:39:57 +01:00
cinap_lenrek d5d6724805 devenv: simplify envremove(), cleanup 2015-08-03 22:08:10 +02:00
cinap_lenrek 37e4ce0ea7 devenv: avoid indirection, keep Evalue's allocated in an array
avoid the indirection for envlookup() by allocating Evalue structs
together in an array. remove unused link field in Evalue.
2015-08-02 21:39:33 +02:00
cinap_lenrek bedffdd8c3 devenv: prevent non-hostowner from creating or removing variables in '#ec', cleanup 2014-08-13 23:09:47 +02:00
cinap_lenrek 061d55111b add Etoolong error string, cleanup genbuf truncation fix 2012-02-08 02:32:03 +01:00
cinap_lenrek 022fd02b96 fix endless devwalk loops caused by genbuf truncation 2012-02-08 00:00:42 +01:00
cinap_lenrek 5acde1e791 make smalloc() uninterruptable as most callers cant handle it anyway 2012-02-06 05:28:57 +01:00
cinap_lenrek c44b78f739 change definition of Chan.create to return a chan like open 2011-08-17 23:27:31 +02:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00