summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEwald Snel <esnel@users.sourceforge.net>2002-06-23 09:12:45 +0000
committerEwald Snel <esnel@users.sourceforge.net>2002-06-23 09:12:45 +0000
commit03e35b6bdfb2af9cbb7e93176250a89b35d754e4 (patch)
tree6e069139d9b3fd12860ae6ff73e4ba5de319d21b /src
parent9681cac14f9ec3e4c91315c0f75943ffb820d45a (diff)
downloadxine-lib-03e35b6bdfb2af9cbb7e93176250a89b35d754e4.tar.gz
xine-lib-03e35b6bdfb2af9cbb7e93176250a89b35d754e4.tar.bz2
Use much faster calloc instead of malloc/memset (reduces startup time)
CVS patchset: 2133 CVS date: 2002/06/23 09:12:45
Diffstat (limited to 'src')
-rw-r--r--src/xine-utils/utils.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index 65c678b6a..111d40cb8 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: utils.c,v 1.7 2002/05/14 03:02:45 miguelfreitas Exp $
+ * $Id: utils.c,v 1.8 2002/06/23 09:12:45 esnel Exp $
*
*/
#define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */
@@ -45,14 +45,12 @@ void *xine_xmalloc(size_t size) {
if( !size )
size++;
- if((ptr = malloc(size)) == NULL) {
+ if((ptr = calloc(1, size)) == NULL) {
fprintf(stderr, "%s: malloc() failed: %s.\n",
__XINE_FUNCTION__, strerror(errno));
return NULL;
}
- memset(ptr, 0, size);
-
return ptr;
}