* tests/test_malloc.c (run_one_test): Test AO_malloc() result
(if out of memory then print the message and abort).
* tests/test_stack.c (add_elements): Ditto.
2011-06-03 Ivan Maidanski <ivmai@mail.ru>
+ * tests/test_malloc.c (run_one_test): Test AO_malloc() result
+ (if out of memory then print the message and abort).
+ * tests/test_stack.c (add_elements): Ditto.
+
+2011-06-03 Ivan Maidanski <ivmai@mail.ru>
+
* src/atomic_ops/generalize.h (AO_HAVE_or_full): Add missing
definition.
* src/atomic_ops/sysdeps/ordered_except_wr.h (AO_HAVE_nop_write):
} else {
p[0] = p[LARGE_OBJ_SIZE/2] = p[LARGE_OBJ_SIZE-1] = 'a';
q = AO_malloc(LARGE_OBJ_SIZE);
+ if (q == 0)
+ {
+ fprintf(stderr, "Out of memory\n");
+ /* Normal for more than about 10 threads without mmap? */
+ abort();
+ }
q[0] = q[LARGE_OBJ_SIZE/2] = q[LARGE_OBJ_SIZE-1] = 'b';
if (p[0] != 'a' || p[LARGE_OBJ_SIZE/2] != 'a'
|| p[LARGE_OBJ_SIZE-1] != 'a') {
if (n == 0) return;
add_elements(n-1);
le = malloc(sizeof(list_element));
+ if (le == 0)
+ {
+ fprintf(stderr, "Out of memory\n");
+ abort();
+ }
le -> data = n;
AO_stack_push(&the_list, (AO_t *)le);
}