PIPS
malloc.c File Reference
#include <config.h>
#include <stdlib.h>
#include <errno.h>
+ Include dependency graph for malloc.c:

Go to the source code of this file.

Macros

#define _GL_USE_STDLIB_ALLOC   1
 malloc() function that is glibc compatible. More...
 

Functions

void * rpl_malloc (size_t n)
 Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. More...
 

Macro Definition Documentation

◆ _GL_USE_STDLIB_ALLOC

#define _GL_USE_STDLIB_ALLOC   1

malloc() function that is glibc compatible.

Copyright (C) 1997-1998, 2006-2007, 2009-2011 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
written by Jim Meyering and Bruno Haible

Definition at line 21 of file malloc.c.

Function Documentation

◆ rpl_malloc()

void* rpl_malloc ( size_t  n)

Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.


Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block.

Definition at line 40 of file malloc.c.

41 {
42  void *result;
43 
44 #if NEED_MALLOC_GNU
45  if (n == 0)
46  n = 1;
47 #endif
48 
49  result = malloc (n);
50 
51 #if !HAVE_MALLOC_POSIX
52  if (result == NULL)
53  errno = ENOMEM;
54 #endif
55 
56  return result;
57 }
void * malloc(YYSIZE_T)

References malloc().

+ Here is the call graph for this function: