[5/9] wpp: Handle remaining memory allocation failures [try 2]

Matteo Bruni matteo.mystral at gmail.com
Fri Oct 2 06:37:24 CDT 2009


2009/10/2 Alexandre Julliard <julliard at winehq.org>:
> Matteo Bruni <matteo.mystral at gmail.com> writes:
>
>> @@ -82,8 +82,7 @@ void *pp_xmalloc(size_t size)
>>      res = malloc(size);
>>      if(res == NULL)
>>      {
>> -        fprintf(stderr, "Virtual memory exhausted.\n");
>> -        exit(2);
>> +        pp_internal_error(__FILE__, __LINE__, "Virtual memory exhausted.\n");
>>      }
>>      return res;
>>  }
>> @@ -96,8 +95,7 @@ void *pp_xrealloc(void *p, size_t size)
>>      res = realloc(p, size);
>>      if(res == NULL)
>>      {
>> -        fprintf(stderr, "Virtual memory exhausted.\n");
>> -        exit(2);
>> +        pp_internal_error(__FILE__, __LINE__, "Virtual memory exhausted.\n");
>
> Memory allocation failures are not internal errors.
>
> --
> Alexandre Julliard
> julliard at winehq.org
>

Which is the best way to notify the condition? ppy_error and
ppy_warning don't seem to be applicable here either, debug channels
aren't used in wpp. Is it ok to simply keep the fprintf?



More information about the wine-devel mailing list