Mercurial > pt1.oyama
comparison src/recpt1.c @ 142:d65c15276b5e
Fix consume large amounts of memory.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Sun, 29 Jul 2012 22:56:53 +0900 |
parents | 519a035533f6 |
children | bf96eac4dbb1 |
comparison
equal
deleted
inserted
replaced
141:519a035533f6 | 142:d65c15276b5e |
---|---|
150 | 150 |
151 QUEUE_T * | 151 QUEUE_T * |
152 create_queue(size_t size) | 152 create_queue(size_t size) |
153 { | 153 { |
154 QUEUE_T *p_queue; | 154 QUEUE_T *p_queue; |
155 int memsize = sizeof(QUEUE_T) + size * sizeof(BUFSZ); | 155 int memsize = sizeof(QUEUE_T) + size * sizeof(BUFSZ*); |
156 | 156 |
157 p_queue = (QUEUE_T*)calloc(memsize, sizeof(char)); | 157 p_queue = (QUEUE_T*)calloc(memsize, sizeof(char)); |
158 | 158 |
159 if(p_queue != NULL) { | 159 if(p_queue != NULL) { |
160 p_queue->size = size; | 160 p_queue->size = size; |
172 | 172 |
173 STREAM_QUEUE_T * | 173 STREAM_QUEUE_T * |
174 create_stream_queue(size_t size) | 174 create_stream_queue(size_t size) |
175 { | 175 { |
176 STREAM_QUEUE_T *p_queue; | 176 STREAM_QUEUE_T *p_queue; |
177 int memsize = sizeof(STREAM_QUEUE_T) + size * sizeof(ARIB_STD_B25_BUFFER); | 177 int memsize = sizeof(STREAM_QUEUE_T) + size * sizeof(ARIB_STD_B25_BUFFER*); |
178 | 178 |
179 p_queue = (STREAM_QUEUE_T*)calloc(memsize, sizeof(char)); | 179 p_queue = (STREAM_QUEUE_T*)calloc(memsize, sizeof(char)); |
180 | 180 |
181 if(p_queue != NULL) { | 181 if(p_queue != NULL) { |
182 p_queue->size = size; | 182 p_queue->size = size; |