HYPRE_Int hypre_StructKrylovFree( char *ptr ) { hypre_Free( ptr ); return hypre_error_flag; }
char * hypre_ReAlloc( char *ptr, int size ) { #ifdef HYPRE_USE_UMALLOC if (ptr == NULL) { ptr = hypre_MAlloc(size); } else if (size == 0) { hypre_Free(ptr); } else { int threadid = hypre_GetThreadID(); ptr = _urealloc_(ptr, size); } #else ptr = realloc(ptr, size); #endif #if 1 if ((ptr == NULL) && (size > 0)) { hypre_OutOfMemory(size); } #endif return ptr; }
HYPRE_Int hypre_ParKrylovFree( char *ptr ) { HYPRE_Int ierr = 0; hypre_Free( ptr ); return ierr; }
int hypre_StructKrylovFree( char *ptr ) { int ierr = 0; hypre_Free( ptr ); return ierr; }
void hypre_SharedFree( char *ptr ) { int unthreaded = pthread_equal(initial_thread, pthread_self()); int I_call_free = unthreaded || pthread_equal(hypre_thread[0],pthread_self()); hypre_barrier(&talloc_mtx, unthreaded); if (I_call_free) { hypre_Free(ptr); } hypre_barrier(&talloc_mtx, unthreaded); }
int hypre_SMGResidualDestroy(void *residual_vdata) { int ierr = 0; hypre_SMGResidualData *residual_data = residual_vdata; if (residual_data != (0)) { hypre_StructMatrixDestroy((residual_data -> A)); hypre_StructVectorDestroy((residual_data -> x)); hypre_StructVectorDestroy((residual_data -> b)); hypre_StructVectorDestroy((residual_data -> r)); hypre_BoxArrayDestroy((residual_data -> base_points)); hypre_ComputePkgDestroy((residual_data -> compute_pkg)); hypre_FinalizeTiming((residual_data -> time_index)); (hypre_Free(((char *)residual_data)) , (residual_data = ((0)))); } return ierr; }