svn commit: r316492 - in head/usr.bin/grep: . regex

Conrad Meyer cem at freebsd.org
Tue Apr 4 19:27:38 UTC 2017


On Tue, Apr 4, 2017 at 12:16 PM, Kyle Evans <kevans91 at ksu.edu> wrote:
> On Tue, Apr 4, 2017 at 1:56 PM, Dimitry Andric <dim at freebsd.org> wrote:
>>
>> > Where did xmalloc.c originate from?
>>
>> GNU.  Almost all software from the GNU project relies on malloc wrappers
>> which abort the program on allocation failures.
>
>
> This also explains the grep_* versions of `malloc`, `calloc`, `realloc`, and
> `strdup` that I've developed a slight distaste for. The "xmalloc" flavor
> also had some hash table bits to allow failing after $n allocations -- is
> that a slightly less common GNU-ism?

Aborting-on-failure malloc wrappers didn't begin or end at GNU.  I
don't think bsdgrep's malloc wrappers have anything to do with GNU.
(xmalloc didn't at least; I haven't looked at the grep_malloc stuff).

Best,
Conrad


More information about the svn-src-head mailing list