Logo ROOT  
Reference Guide
mcalloc.c
Go to the documentation of this file.
1/* @(#)root/clib:$Id$ */
2/* Author: */
3
4/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
5This file is part of the GNU C Library.
6
7The GNU C Library is free software; you can redistribute it and/or
8modify it under the terms of the GNU Library General Public License as
9published by the Free Software Foundation; either version 2 of the
10License, or (at your option) any later version.
11
12The GNU C Library is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15Library General Public License for more details.
16
17You should have received a copy of the GNU Library General Public
18License along with the GNU C Library; see the file COPYING.LIB. If
19not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22#include <string.h> /* Prototypes for memcpy, memmove, memset, etc */
23
24#include "mmprivate.h"
25
26/* Allocate an array of NMEMB elements each SIZE bytes long.
27 The entire array is initialized to zeros. */
28
29PTR mcalloc(PTR md, register size_t nmemb, register size_t size)
30{
31 register PTR result;
32
33 if ((result = mmalloc (md, nmemb * size)) != NULL)
34 {
35 memset (result, 0, nmemb * size);
36 }
37 return (result);
38}
39
40/* When using this package, provide a version of malloc/realloc/free built
41 on top of it, so that if we use the default sbrk() region we will not
42 collide with another malloc package trying to do the same thing, if
43 the application contains any "hidden" calls to malloc/realloc/free (such
44 as inside a system library). */
45
46#ifndef NO_SBRK_MALLOC
47
48PTR
49calloc (nmemb, size)
50 size_t nmemb;
51 size_t size;
52{
53 return (mcalloc ((PTR) NULL, nmemb, size));
54}
55
56#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
#define NULL
Definition ZInflate.c:15
#define calloc
Definition civetweb.c:1576
PTR mcalloc(PTR md, register size_t nmemb, register size_t size)
Definition mcalloc.c:29
PTR mmalloc(PTR md, size_t size)
Definition mmalloc.c:125
#define PTR
Definition mmalloc.h:29