Branch: Tag:

2006-05-10

2006-05-10 19:43:54 by Martin Stjernholm <mast@lysator.liu.se>

Show the size of the block that was attempted to be allocated when an out of
memory error occurs.

Rev: src/array.c:1.192
Rev: src/error.c:1.146
Rev: src/pike_error.h:1.38
Rev: src/pike_memory.c:1.176

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_error.h,v 1.37 2006/02/27 12:07:10 mast Exp $ + || $Id: pike_error.h,v 1.38 2006/05/10 19:43:54 mast Exp $   */      #ifndef PIKE_ERROR_H
326:    wrong_number_of_args_error (FUNC, args, ARG)      PMOD_EXPORT extern const char msg_out_of_mem[]; + PMOD_EXPORT extern const char msg_out_of_mem_2[]; +  + static INLINE void DECLSPEC(noreturn) out_of_memory_error ( +  const char *func, +  struct svalue *base_sp, int args, +  size_t amount) ATTRIBUTE((noreturn)); + static INLINE void DECLSPEC(noreturn) out_of_memory_error ( +  const char *func, +  struct svalue *base_sp, int args, +  size_t amount) + { +  resource_error (func, base_sp, args, "memory", amount, +  msg_out_of_mem_2, amount); + } +    #define SIMPLE_OUT_OF_MEMORY_ERROR(FUNC, AMOUNT) \ -  resource_error(FUNC, Pike_sp-args, args, "memory", AMOUNT, msg_out_of_mem) +  out_of_memory_error(FUNC, Pike_sp-args, args, AMOUNT)      PMOD_EXPORT extern const char msg_div_by_zero[];   #define SIMPLE_DIVISION_BY_ZERO_ERROR(FUNC) \