2005-11-18 18:54:58 +03:00
|
|
|
/*
|
|
|
|
* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
|
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "cext.h"
|
|
|
|
|
2005-12-08 03:31:23 +03:00
|
|
|
void *cext_emallocz(size_t size)
|
2005-11-18 18:54:58 +03:00
|
|
|
{
|
2005-12-08 03:31:23 +03:00
|
|
|
void *res = calloc(1, size);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
if (!res) {
|
|
|
|
fprintf(stderr, "fatal: could not malloc() %d bytes\n",
|
2005-12-05 01:45:59 +03:00
|
|
|
(int) size);
|
2005-11-18 18:54:58 +03:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|