# PetscSegBufferExtractAlloc
extract contiguous data to new allocation and reset segmented buffer 
## Synopsis
```
PetscErrorCode PetscSegBufferExtractAlloc(PetscSegBuffer seg, void *contiguous)
```
Not Collective


## Input Parameter

- ***seg -*** segmented buffer



## Output Parameter

- ***contiguous -*** address of new array containing contiguous data, caller frees with `PetscFree()`





## Developer Note
'seg' argument is a pointer so that implementation could reallocate, though this is not currently done


## See Also
 `PetscSegBufferCreate()`, `PetscSegBufferGet()`, `PetscSegBufferDestroy()`, `PetscSegBufferExtractTo()`, `PetscSegBufferExtractInPlace()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/segbuffer.c.html#PetscSegBufferExtractAlloc">src/sys/utils/segbuffer.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/utils/segbuffer.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
