PetscObjectGetReference — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscObjectGetReference

Gets the current reference count for a PETSc object.

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscObjectGetReference(PetscObject obj, PetscInt *cnt)

Not Collective

## Input Parameter

- obj - the PETSc object; this must be cast with (`PetscObject`), for example, `PetscObjectGetReference`((`PetscObject`)mat,&cnt); `obj` cannot be `NULL`

## Output Parameter

- cnt - the reference count

## See Also

`PetscObjectCompose()`, `PetscObjectDereference()`, `PetscObjectReference()`, `PetscObject`

## Level

advanced

## Location

src/sys/objects/inherit.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages