Changeset 0594c7ea in mainline
- Timestamp:
- 2012-07-12T18:31:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 057e77f
- Parents:
- e25eb9e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/synch/rcu1.c
re25eb9e3 r0594c7ea 250 250 { 251 251 for (int i = 0; i < nop_updater_iters; i += 2){ 252 rcu_item_t *a = malloc(sizeof(rcu_item_t), 0);253 rcu_item_t *b = malloc(sizeof(rcu_item_t), 0);252 rcu_item_t *a = malloc(sizeof(rcu_item_t), FRAME_ATOMIC); 253 rcu_item_t *b = malloc(sizeof(rcu_item_t), FRAME_ATOMIC); 254 254 255 255 if (a && b) { … … 257 257 rcu_call(b, count_cb); 258 258 } else { 259 TPRINTF("[out-of-mem]\n"); 259 260 free(a); 260 261 free(b); 262 return; 261 263 } 262 264 } … … 312 314 rcu_read_lock(); 313 315 314 item_w_cookie_t *item = malloc(sizeof(item_w_cookie_t), 0);316 item_w_cookie_t *item = malloc(sizeof(item_w_cookie_t), FRAME_ATOMIC); 315 317 316 318 if (item) { … … 412 414 /* Updater */ 413 415 for (size_t i = 0; i < work->update_cnt; ++i) { 414 seq_item_t *a = malloc(sizeof(seq_item_t), 0);415 seq_item_t *b = malloc(sizeof(seq_item_t), 0);416 seq_item_t *a = malloc(sizeof(seq_item_t), FRAME_ATOMIC); 417 seq_item_t *b = malloc(sizeof(seq_item_t), FRAME_ATOMIC); 416 418 417 419 if (a && b) { … … 512 514 TPRINTF("\nReader exits thread with rcu_lock\n"); 513 515 514 exited_t *p = malloc(sizeof(exited_t), 0); 516 exited_t *p = malloc(sizeof(exited_t), FRAME_ATOMIC); 517 if (!p) { 518 TPRINTF("[out-of-mem]\n"); 519 return false; 520 } 521 515 522 p->exited = false; 516 523 … … 670 677 static bool do_one_reader_preempt(void (*f)(void*), const char *err) 671 678 { 672 preempt_t *p = malloc(sizeof(preempt_t), 0); 673 ASSERT(p); 679 preempt_t *p = malloc(sizeof(preempt_t), FRAME_ATOMIC); 680 if (!p) { 681 TPRINTF("[out-of-mem]\n"); 682 return false; 683 } 684 674 685 p->e.exited = false; 675 686 p->result = EOK; … … 756 767 TPRINTF("\nSynchronize with long reader\n"); 757 768 758 synch_t *synch = malloc(sizeof(synch_t), 0);769 synch_t *synch = malloc(sizeof(synch_t), FRAME_ATOMIC); 759 770 760 771 if (!synch) { 772 TPRINTF("[out-of-mem]\n"); 761 773 return false; 762 774 } … … 826 838 827 839 for (size_t i = 0; i < s->iters; ++i) { 828 rcu_item_t *item = malloc(sizeof(rcu_item_t), 0);829 830 if (item) 840 rcu_item_t *item = malloc(sizeof(rcu_item_t), FRAME_ATOMIC); 841 842 if (item) { 831 843 rcu_call(item, stress_cb); 844 } else { 845 TPRINTF("[out-of-mem]\n"); 846 return; 847 } 832 848 833 849 /* Print a dot if we make progress of 1% */
Note:
See TracChangeset
for help on using the changeset viewer.