From: FUJITA T. <fuj...@la...> - 2005-03-31 04:06:36
|
From: Ming Zhang <mi...@el...> Subject: [Iscsitarget-devel] xmalloc Date: Wed, 30 Mar 2005 15:13:29 -0500 > what is the purpose of this code? > > in usr/target.c, This is the original Ardis code. Some people like wrapper functions for error checking. And xmalloc is often used for the wrapper function for malloc. http://www.tug.org/tex-archive/dviware/dvi2xx/xmalloc.c > void *xmalloc(size_t size) > { > void *ptr; > > if (size == 0) > ; > ptr = malloc(size); > if (ptr == NULL) > ; > return ptr; > } I think that an Ardis developer intended to put some debugging code here, but he didn't after all. Anyway, I don't like such wrapper functions. If you send me a patch to replace xmalloc with malloc, I'm happy to apply it. |