Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion (original) (raw)

Martin Buchholz martinrb at google.com
Thu Dec 20 04:32:45 UTC 2012


s/4/sizeof(magic)/


+extern int errno;

Delete.


+#define ALLOC(X,Y) { \

+}

It's traditional to define such a thing as a real function instead of a macro, often with the name xmalloc.

Compare with

static void* xmalloc(JNIEnv *env, size_t size) { void *p = malloc(size); if (p == NULL) JNU_ThrowOutOfMemoryError(env, NULL); return p; }

#define NEW(type, n) ((type *) xmalloc(env, (n) * sizeof(type)))



More information about the core-libs-dev mailing list