Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 180 of file priorityq.c.
{ long curr; if( pq->initialized ) { return __gl_pqHeapInsert( pq->heap, keyNew ); } curr = pq->size; if( ++ pq->size >= pq->max ) { PQkey *saveKey= pq->keys; /* If the heap overflows, double its size. */ pq->max <<= 1; pq->keys = (PQHeapKey *)memRealloc( pq->keys, (size_t) (pq->max * sizeof( pq->keys[0] ))); if (pq->keys == NULL) { pq->keys = saveKey; /* restore ptr to free upon return */ return LONG_MAX; } } assert(curr != LONG_MAX); pq->keys[curr] = keyNew; /* Negative handles index the sorted array. */ return -(curr+1); }