* lu_reallocix() - reallocate two arrays * * @nz new number of elements per array * @p_Ai location of pointer to integer memory * @p_Ax location of pointer to floating point memory * * If a reallocation fails, then do not overwrite the old pointer. * * Return: BASICLU_OK or BASICLU_ERROR_out_of_memory */
| 30 | * Return: BASICLU_OK or BASICLU_ERROR_out_of_memory |
| 31 | */ |
| 32 | static lu_int lu_reallocix(lu_int nz, lu_int **p_Ai, double **p_Ax) |
| 33 | { |
| 34 | lu_int *Ainew; |
| 35 | double *Axnew; |
| 36 | |
| 37 | Ainew = realloc(*p_Ai, nz * sizeof(lu_int)); |
| 38 | if (Ainew) |
| 39 | *p_Ai = Ainew; |
| 40 | Axnew = realloc(*p_Ax, nz * sizeof(double)); |
| 41 | if (Axnew) |
| 42 | *p_Ax = Axnew; |
| 43 | |
| 44 | return Ainew && Axnew ? BASICLU_OK : BASICLU_ERROR_out_of_memory; |
| 45 | } |
| 46 | |
| 47 | /* |
| 48 | * lu_realloc_obj() |