Ruby: pm_string_t Struct Reference

Ruby 3.4.4p34 (2025-05-14 revision a38531fd3f617bf734ef7d6c595325f69985ea1d)

Public Types | Data Fields
pm_string_t Struct Reference

A generic string type that can have various ownership semantics. More...

`#include <pm_string.h>`

## Public Types
enum | { PM_STRING_CONSTANT , PM_STRING_SHARED , PM_STRING_OWNED }
| The type of the string. More...

## Data Fields
const uint8_t * | source
| A pointer to the start of the string.
size_t | length
| The length of the string in bytes of memory.
enum pm_string_t:: { ... } | type
| The type of the string.

## Detailed Description

A generic string type that can have various ownership semantics.

Definition at line 33 of file pm_string.h.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

The type of the string.

This field determines how the string should be freed.

Enumerator
PM_STRING_CONSTANT | This string is a constant string, and should not be freed.
PM_STRING_SHARED | This is a slice of another string, and should not be freed.
PM_STRING_OWNED | This string owns its memory, and should be freed using `pm_string_free`.

Definition at line 41 of file pm_string.h.

## Field Documentation

## ◆ length

size_t pm_string_t::length

The length of the string in bytes of memory.

Definition at line 38 of file pm_string.h.

Referenced by pm_string_free().

## ◆ source

const uint8_t* pm_string_t::source

A pointer to the start of the string.

Definition at line 35 of file pm_string.h.

Referenced by pm_string_ensure_owned(), and pm_string_free().

## ◆ []

enum { ... } pm_string_t::type

The type of the string.

This field determines how the string should be freed.

Referenced by pm_string_ensure_owned(), and pm_string_free().

The documentation for this struct was generated from the following file:

- prism/util/pm_string.h