| 2584 | } |
| 2585 | |
| 2586 | int prealloc_(CSOUND *csound, AOP *p, int instname) |
| 2587 | { |
| 2588 | int n, a; |
| 2589 | |
| 2590 | if (instname) |
| 2591 | n = (int) strarg2opcno(csound, ((STRINGDAT*)p->r)->data, 1, |
| 2592 | (*p->b == FL(0.0) ? 0 : 1)); |
| 2593 | else { |
| 2594 | if (csound->ISSTRCOD(*p->r)) |
| 2595 | n = (int) strarg2opcno(csound, get_arg_string(csound,*p->r), 1, |
| 2596 | (*p->b == FL(0.0) ? 0 : 1)); |
| 2597 | else n = *p->r; |
| 2598 | } |
| 2599 | |
| 2600 | if (UNLIKELY(n == NOT_AN_INSTRUMENT)) return NOTOK; |
| 2601 | if (csound->oparms->realtime) |
| 2602 | csoundSpinLock(&csound->alloc_spinlock); |
| 2603 | a = (int) *p->a - csound->engineState.instrtxtp[n]->active; |
| 2604 | for ( ; a > 0; a--) |
| 2605 | instance(csound, n); |
| 2606 | if (csound->oparms->realtime) |
| 2607 | csoundSpinUnLock(&csound->alloc_spinlock); |
| 2608 | return OK; |
| 2609 | } |
| 2610 | |
| 2611 | int prealloc(CSOUND *csound, AOP *p){ |
| 2612 | return prealloc_(csound,p,0); |
no test coverage detected