<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/bin/sh/memalloc.h, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=stable%2F14</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=stable%2F14'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-16T17:54:23Z</updated>
<entry>
<title>Remove $FreeBSD$: one-line .h pattern</title>
<updated>2023-08-16T17:54:23Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=42b388439bd3795e09258c57a74ce9eec3651c7b'/>
<id>urn:sha1:42b388439bd3795e09258c57a74ce9eec3651c7b</id>
<content type='text'>
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>General further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-20T19:49:47Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-20T19:49:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8a16b7a18f5d0b031f09832fd7752fba717e2a97'/>
<id>urn:sha1:8a16b7a18f5d0b031f09832fd7752fba717e2a97</id>
<content type='text'>
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
</content>
</entry>
<entry>
<title>Renumber copyright clause 4</title>
<updated>2017-02-28T23:42:47Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2017-02-28T23:42:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fbbd9655e5107c68e4e0146ff22b73d7350475bc'/>
<id>urn:sha1:fbbd9655e5107c68e4e0146ff22b73d7350475bc</id>
<content type='text'>
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann &lt;jschauma@stevens.edu&gt;
Pull Request:	https://github.com/freebsd/freebsd/pull/96
</content>
</entry>
<entry>
<title>sh: Add stsavestr(), like savestr() but allocates using stalloc().</title>
<updated>2015-02-15T21:41:29Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2015-02-15T21:41:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a4652c280b6f8a5b34143413f685d94b86e8b78c'/>
<id>urn:sha1:a4652c280b6f8a5b34143413f685d94b86e8b78c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sh: Remove linked list of stack marks.</title>
<updated>2013-05-11T20:51:00Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2013-05-11T20:51:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=336e0c87fa2b1bb2fb9da11c09e9e7e0df684696'/>
<id>urn:sha1:336e0c87fa2b1bb2fb9da11c09e9e7e0df684696</id>
<content type='text'>
The linked list of stack marks may cause problems if the allocation stack is
used between an exception and a higher-level popstackmark(), as it may then
touch a stack mark that is local to a function which has returned.

Also, the adjustment compares to a pointer passed to realloc(), which is
undefined behaviour.

Instead of adjusting stack marks when reallocating stack blocks, ensure that
such an adjustment is never necessary by fixing a small piece of memory in
place at a stack mark. This also simplifies the code.

To avoid the problems reported in bin/175922, it remains necessary to call
setstackmark() after popstackmark() if the stack mark remains in use.
</content>
</entry>
<entry>
<title>sh: Fix various compiler warnings.</title>
<updated>2013-04-01T17:18:22Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2013-04-01T17:18:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=46c6b52dfb4b0396494b08f60c80e32236df1aaf'/>
<id>urn:sha1:46c6b52dfb4b0396494b08f60c80e32236df1aaf</id>
<content type='text'>
It now passes WARNS=7 with clang on i386.

GCC 4.2.1 does not understand setjmp() properly so will always trigger
-Wuninitialized. I will not add the volatile keywords to suppress this.
</content>
</entry>
<entry>
<title>sh: Follow-up to r216743, grabstackblock() can be replaced with stalloc().</title>
<updated>2011-01-09T22:47:58Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2011-01-09T22:47:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=33a8413363fd2057d99166b6254edd6c34b0224b'/>
<id>urn:sha1:33a8413363fd2057d99166b6254edd6c34b0224b</id>
<content type='text'>
grabstackblock() was used only once (but it is a very often executed piece
of code).
</content>
</entry>
<entry>
<title>sh: Simplify "stack string" code slightly.</title>
<updated>2010-12-27T22:18:27Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2010-12-27T22:18:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ff802dc7bbf970a8cd17c40600c49b29540f4f58'/>
<id>urn:sha1:ff802dc7bbf970a8cd17c40600c49b29540f4f58</id>
<content type='text'>
Maintain a pointer to the end of the stack string area instead of how much
space is left. This simplifies the macros in memalloc.h. The places where
the new variable must be updated are only where the memory area is created,
destroyed or resized.
</content>
</entry>
<entry>
<title>sh: Allow arbitrary large numbers in CHECKSTRSPACE.</title>
<updated>2010-12-26T13:25:47Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2010-12-26T13:25:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d8f32e72878cc01f2bf93fb164756f14db521661'/>
<id>urn:sha1:d8f32e72878cc01f2bf93fb164756f14db521661</id>
<content type='text'>
Reduce "stack string" API somewhat and simplify code.
Add a check for integer overflow of the "stack string" length (probably
incomplete).
</content>
</entry>
<entry>
<title>sh: Remove the herefd hack.</title>
<updated>2010-12-12T00:07:27Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2010-12-12T00:07:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9f5a68a00248e5608c353c138c39f32d797d99dc'/>
<id>urn:sha1:9f5a68a00248e5608c353c138c39f32d797d99dc</id>
<content type='text'>
The herefd hack wrote out partial here documents while expanding them. It
seems unnecessary complication given that other expansions just allocate
memory. It causes bugs because the stack is also used for intermediate
results such as arithmetic expressions. Such places should disable herefd
for the duration but not all of them do, and I prefer removing the need for
disabling herefd to disabling it everywhere needed.

Here documents larger than 1024 bytes will use a bit more CPU time and
memory.

Additionally this allows a later change to expand here documents in the
current shell environment. (This is faster for small here documents but also
changes behaviour.)

Obtained from:	dash
</content>
</entry>
</feed>
