mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (add_signal_thread_list): use xmalloc instead
of malloc. * thread_pthread.c (remove_signal_thread_list): use xfree instead of free. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3fd4cf507
commit
c878761f3b
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
Sun May 8 10:54:06 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* thread_pthread.c (add_signal_thread_list): use xmalloc instead
|
||||
of malloc.
|
||||
* thread_pthread.c (remove_signal_thread_list): use xfree instead
|
||||
of free.
|
||||
|
||||
Sun May 8 10:24:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* thread_pthread.c: cleanup signal_thread_list related ifdef.
|
||||
|
|
|
@ -897,7 +897,7 @@ add_signal_thread_list(rb_thread_t *th)
|
|||
if (!th->native_thread_data.signal_thread_list) {
|
||||
FGLOCK(&signal_thread_list_lock, {
|
||||
struct signal_thread_list *list =
|
||||
malloc(sizeof(struct signal_thread_list));
|
||||
xmalloc(sizeof(struct signal_thread_list));
|
||||
|
||||
if (list == 0) {
|
||||
fprintf(stderr, "[FATAL] failed to allocate memory\n");
|
||||
|
@ -932,7 +932,7 @@ remove_signal_thread_list(rb_thread_t *th)
|
|||
}
|
||||
th->native_thread_data.signal_thread_list = 0;
|
||||
list->th = 0;
|
||||
free(list); /* ok */
|
||||
xfree(list); /* ok */
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue