Dealing with the xalloc->malloc change

Keith Packard keithp at keithp.com
Thu May 13 14:09:08 PDT 2010


On Thu, 13 May 2010 15:01:15 -0400, Adam Jackson <ajax at nwnk.net> wrote:

> void *
> Xcalloc(unsigned long amount)
> /* ... */

Yeah, I try to forget that.

#!/bin/sh
sed -i \
    -e 's/\<[Xx]alloc\> *(/malloc(/' \
    -e 's/\<[Xx]free\> *(/free(/' \
    -e 's/\<[Xx]realloc\> *(/realloc(/' \
    -e 's/\<xcalloc\> *(/calloc(/' \
    -e 's'\<Xcalloc\> *(/calloc(1, /' \
    "$@"

> How awesome is it that we defeated the most useful part of calloc?

Wrapping malloc is all about awesome.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100513/d47d92f1/attachment.pgp>


More information about the xorg-devel mailing list