add some more comments

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@271 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-11-04 18:57:31 +00:00
parent 1f6a90c963
commit 344ced4622
3 changed files with 80 additions and 16 deletions

View file

@ -30,19 +30,22 @@
#include "memory.h"
#include "util.h"
#define MAX_ALLOC_SIZE (1024*1024*20)
/* Make sure not to allocate more than this much memory. */
#define MAX_ALLOC_SIZE (1024*1024*20) /* 20MB */
#undef malloc
#undef free
#undef realloc
#undef strndup
#undef strdup
/* #undef malloc */
/* #undef free */
/* #undef realloc */
/* #undef strndup */
/* #undef strdup */
/** called in case of an OOM situation. Prints an error message and
* exits */
static void oom(void) {
static const char e[] = "Not enough memory\n";
pa_loop_write(2, e, sizeof(e)-1);
pa_loop_write(STDERR_FILENO, e, sizeof(e)-1);
raise(SIGQUIT);
exit(1);
_exit(1);
}
void* pa_xmalloc(size_t size) {