segment_create: Create a new shared memory segment

View source: R/segment.R

segment_createR Documentation

Create a new shared memory segment

Description

Create a new shared memory segment

Usage

segment_create(
  size,
  backing = c("auto", "mmap", "shm"),
  path = NULL,
  readonly = FALSE
)

Arguments

size

Size of the segment in bytes

backing

Backing type: "auto", "mmap", or "shm"

path

Optional file path for mmap backing (NULL for temp file)

readonly

Create as read-only (after initial write)

Value

A shard_segment object backed by shared memory.

Examples


seg <- segment_create(1024 * 1024)
segment_info(seg)
segment_close(seg)


shard documentation built on April 3, 2026, 9:08 a.m.