Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Queue_impl
comparison BlockingQueue.c @ 10:88efea74818a
Fixed some free s missed before
| author | Me |
|---|---|
| date | Tue, 02 Nov 2010 16:48:22 -0700 |
| parents | 62326cc8e6f4 |
| children | 3562716ebdbd |
comparison
equal
deleted
inserted
replaced
| 5:b00f61653656 | 6:a1517ee85a66 |
|---|---|
| 252 } | 252 } |
| 253 | 253 |
| 254 void | 254 void |
| 255 freeSRSWQ( SRSWQueueStruc* Q ) | 255 freeSRSWQ( SRSWQueueStruc* Q ) |
| 256 { | 256 { |
| 257 free( Q ); | 257 VMS__free( Q ); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void* readSRSWQ( SRSWQueueStruc* Q ) | 260 void* readSRSWQ( SRSWQueueStruc* Q ) |
| 261 { void *out = 0; | 261 { void *out = 0; |
| 262 int tries = 0; | 262 int tries = 0; |
| 382 | 382 |
| 383 retQ = (SRMWQueueStruc *) VMS__malloc( sizeof( SRMWQueueStruc ) ); | 383 retQ = (SRMWQueueStruc *) VMS__malloc( sizeof( SRMWQueueStruc ) ); |
| 384 | 384 |
| 385 retQ->numInternalQs = 0; | 385 retQ->numInternalQs = 0; |
| 386 retQ->internalQsSz = 10; | 386 retQ->internalQsSz = 10; |
| 387 retQ->internalQs = VMS__malloc( retQ->internalQsSz * sizeof(SRSWQueueStruc *)); | 387 retQ->internalQs = VMS__malloc( retQ->internalQsSz * |
| 388 sizeof(SRSWQueueStruc *) ); | |
| 388 | 389 |
| 389 retQ->lastQReadFrom = 0; | 390 retQ->lastQReadFrom = 0; |
| 390 | 391 |
| 391 return retQ; | 392 return retQ; |
| 392 } | 393 } |
| 412 Q->internalQsSz *= 2; | 413 Q->internalQsSz *= 2; |
| 413 Q->internalQs = VMS__malloc( Q->internalQsSz * sizeof(SRSWQueueStruc *)); | 414 Q->internalQs = VMS__malloc( Q->internalQsSz * sizeof(SRSWQueueStruc *)); |
| 414 for( i = 0; i < oldSz; i++ ) | 415 for( i = 0; i < oldSz; i++ ) |
| 415 { Q->internalQs[i] = oldArray[i]; | 416 { Q->internalQs[i] = oldArray[i]; |
| 416 } | 417 } |
| 417 free( oldArray ); | 418 VMS__free( oldArray ); |
| 418 } | 419 } |
| 419 Q->internalQs[ Q->numInternalQs - 1 ] = makeSRSWQ(); | 420 Q->internalQs[ Q->numInternalQs - 1 ] = makeSRSWQ(); |
| 420 return Q->numInternalQs - 1; | 421 return Q->numInternalQs - 1; |
| 421 } | 422 } |
| 422 | 423 |
