[xml] timsort.h error handling
- From: Ralf Junker <ralfjunker gmx de>
- To: "xml gnome org" <xml gnome org>
- Subject: [xml] timsort.h error handling
- Date: Mon, 01 Oct 2012 17:23:23 +0200
On memory reallocation error, timsort.h just prints to stderr and exits (see code extract below). Should it
not better propagate the error to the libxml2 error handler?
Ralf
static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size)
{
if (store->alloc < new_size)
{
SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
if (tempstore == NULL)
{
fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) *
new_size);
exit(1);
}
store->storage = tempstore;
store->alloc = new_size;
}
}
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]