1N/A Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 1N/A 2000, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software 1N/A This program is free software: you can redistribute it and/or modify 1N/A it under the terms of the GNU General Public License as published by 1N/A the Free Software Foundation; either version 3 of the License, or 1N/A (at your option) any later version. 1N/A This program is distributed in the hope that it will be useful, 1N/A but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A GNU General Public License for more details. 1N/A You should have received a copy of the GNU General Public License 1N/A/* 1 if calloc is known to be compatible with GNU calloc. This 1N/A matters if we are not also using the calloc module, which defines 1N/A HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ 1N/A/* Allocate N bytes of memory dynamically, with error checking. */ 1N/A/* Change the size of an allocated block of memory P to N bytes, 1N/A with error checking. */ 1N/A/* If P is null, allocate a block of at least *PN bytes; otherwise, 1N/A reallocate P so that it contains more than *PN bytes. *PN must be 1N/A nonzero unless P is null. Set *PN to the new block's size, and 1N/A return the pointer to the new block. *PN is never set to zero, and 1N/A the returned pointer is never null. */ 1N/A/* Allocate S bytes of zeroed memory dynamically, with error checking. 1N/A There's no need for xnzalloc (N, S), since it would be equivalent 1N/A to xcalloc (N, S). */ 1N/A/* Allocate zeroed memory for N elements of S bytes, with error 1N/A checking. S must be nonzero. */ 1N/A /* Test for overflow, since some calloc implementations don't have 1N/A proper overflow checks. But omit overflow and size-zero tests if 1N/A HAVE_GNU_CALLOC, since GNU calloc catches overflow and never 1N/A returns NULL if successful. */ 1N/A/* Clone an object P of size S, with error checking. There's no need 1N/A for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any 1N/A need for an arithmetic overflow check. */