Blame malloc/morecore.c

Packit Service 82fcde
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _MALLOC_INTERNAL
Packit Service 82fcde
# define _MALLOC_INTERNAL
Packit Service 82fcde
# include <malloc.h>
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#ifndef __GNU_LIBRARY__
Packit Service 82fcde
# define __sbrk  sbrk
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#ifdef __GNU_LIBRARY__
Packit Service 82fcde
/* It is best not to declare this and cast its result on foreign operating
Packit Service 82fcde
   systems with potentially hostile include files.  */
Packit Service 82fcde
Packit Service 82fcde
# include <stddef.h>
Packit Service 82fcde
# include <stdlib.h>
Packit Service 82fcde
extern void *__sbrk (ptrdiff_t increment) __THROW;
Packit Service 82fcde
libc_hidden_proto (__sbrk)
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#ifndef NULL
Packit Service 82fcde
# define NULL 0
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/* Allocate INCREMENT more bytes of data space,
Packit Service 82fcde
   and return the start of data space, or NULL on errors.
Packit Service 82fcde
   If INCREMENT is negative, shrink data space.  */
Packit Service 82fcde
void *
Packit Service 82fcde
__default_morecore (ptrdiff_t increment)
Packit Service 82fcde
{
Packit Service 82fcde
  void *result = (void *) __sbrk (increment);
Packit Service 82fcde
  if (result == (void *) -1)
Packit Service 82fcde
    return NULL;
Packit Service 82fcde
Packit Service 82fcde
  return result;
Packit Service 82fcde
}
Packit Service 82fcde
libc_hidden_def (__default_morecore)