吕超 <[email protected]> writes: > Your faithfully: > > I use malloc
I presume you mean PetscMalloc. > to allocate memories to 1d or 2d array, if I use function > free(array), error "Caught signal number 11 SEGV: Segmentation > Violation, probably memory access out of range" always appear,. > > However, if I use PetscFree(array), there are no errors? could do > you please tell me why? The interface requires you to use PetscFree with PetscMallic. PetscMalloc has some debugging/alignment features by default, so you can't just pass the pointer to free().
pgpv0wCj3Xrgw.pgp
Description: PGP signature
