Dealing with the xalloc->malloc change

Adam Jackson ajax at nwnk.net
Thu May 13 12:01:15 PDT 2010


On Wed, 2010-05-12 at 15:51 -0700, Keith Packard wrote:
> Here's a script I wrote to switch allocator calls around:
> 
> #!/bin/sh
> sed -i \
>     -e 's/\<[Xx]alloc\> *(/malloc(/' \
>     -e 's/\<[Xx]free\> *(/free(/' \
>     -e 's/\<[Xx]realloc\> *(/realloc(/' \
>     -e 's/\<[Xx]calloc\> *(/calloc(/' \
>     "$@"

That's wrong for Xcalloc:

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

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

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100513/c566981e/attachment.pgp>


More information about the xorg-devel mailing list