---
name: "rtcRetainBuffer"
section: "3"
platform: "linux"
package: "libembree-dev"
version: "4.3.3+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rtcRetainBuffer"
---

# rtcRetainBuffer(3)

### NAME

-

  ```
  rtcRetainBuffer - increments the buffer reference count
  ```

### SYNOPSIS

-

  ```
  #include <embree4/rtcore.h>
  void rtcRetainBuffer(RTCBuffer buffer);
  ```

### DESCRIPTION

Buffer objects are reference counted. The `rtcRetainBuffer` function increments the reference count of the passed buffer object (`buffer` argument). This function together with `rtcReleaseBuffer` allows to use the internal reference counting in a C++ wrapper class to handle the ownership of the object.

### EXIT STATUS

On failure an error code is set that can be queried using `rtcGetDeviceError`.

### SEE ALSO

\[rtcNewBuffer\], \[rtcReleaseBuffer\]
