Skip to content

Latest commit

 

History

History
315 lines (193 loc) · 8.45 KB

File-std-concurrent-shared-value-ml-2112657235.md

File metadata and controls

315 lines (193 loc) · 8.45 KB

std/concurrent/shared_value.ml

Home · Files

Provides the std concurrent shared_value package.

Package: std.concurrent.shared_value

Reachable from entry: no

Declarations

allocate

function allocate(size)

Allocate a writable unmanaged block and return its native address.

Parameter Type Default Description
size dynamic — Value supplied for size.

Source: std/concurrent/shared_value.ml:73

clearRecordAt

function clearRecordAt(address)

Zero a native record without releasing any referenced payload.

Parameter Type Default Description
address dynamic — Value supplied for address.

Source: std/concurrent/shared_value.ml:211

destroyAt

function destroyAt(address)

Release an owned payload and clear its native record.

Parameter Type Default Description
address dynamic — Value supplied for address.

Source: std/concurrent/shared_value.ml:244

encode

function encode(value)

Returns [ok, type, payload, length]. For string/bytes payload owns a native block which must either be written into a record or released.

Parameter Type Default Description
value dynamic — Value to process.

Source: std/concurrent/shared_value.ml:155

free

function free(address)

Release a block previously returned by allocate().

Parameter Type Default Description
address dynamic — Value supplied for address.

Source: std/concurrent/shared_value.ml:84

isShareable

function isShareable(value)

Report whether the legacy snapshot codec supports this value category.

Parameter Type Default Description
value dynamic — Value to process.

Source: std/concurrent/shared_value.ml:148

MEM_COMMIT_RESERVE

const MEM_COMMIT_RESERVE = 12288

Legacy native-value codec retained for compatibility. The managed concurrent collections no longer need it because every thread shares the same GC heap. It remains useful for explicit snapshots passed to unmanaged native memory.

Source: std/concurrent/shared_value.ml:11

MEM_RELEASE

const MEM_RELEASE = 32768

Track the mem release value used by this standard-library module.

Source: std/concurrent/shared_value.ml:13

move

function move(destination, source, count)

Copy count bytes between two unmanaged addresses.

Parameter Type Default Description
destination dynamic — Value supplied for destination.
source dynamic — Source value to process.
count dynamic — Number of items to process.

Source: std/concurrent/shared_value.ml:98

PAGE_READWRITE

const PAGE_READWRITE = 4

Track the page readwrite value used by this standard-library module.

Source: std/concurrent/shared_value.ml:15

readAt

function readAt(address)

Materialize a managed value from one native snapshot record.

Parameter Type Default Description
address dynamic — Value supplied for address.

Source: std/concurrent/shared_value.ml:226

readI64At

function readI64At(address)

Read a signed 64-bit integer from an unmanaged address.

Parameter Type Default Description
address dynamic — Value supplied for address.

Source: std/concurrent/shared_value.ml:140

RECORD_SIZE

const RECORD_SIZE = 24

Track the record size value used by this standard-library module.

Source: std/concurrent/shared_value.ml:17

releaseEncoded

function releaseEncoded(encoded)

Release the payload owned by an encoded string or bytes snapshot.

Parameter Type Default Description
encoded dynamic — Value supplied for encoded.

Source: std/concurrent/shared_value.ml:185

TYPE_BOOL

const TYPE_BOOL = 2

Track the type bool value used by this standard-library module.

Source: std/concurrent/shared_value.ml:24

TYPE_BYTES

const TYPE_BYTES = 4

Track the type bytes value used by this standard-library module.

Source: std/concurrent/shared_value.ml:28

TYPE_INT

const TYPE_INT = 1

Track the type int value used by this standard-library module.

Source: std/concurrent/shared_value.ml:22

TYPE_STRING

const TYPE_STRING = 3

Track the type string value used by this standard-library module.

Source: std/concurrent/shared_value.ml:26

TYPE_VOID

const TYPE_VOID = 0

Track the type void value used by this standard-library module.

Source: std/concurrent/shared_value.ml:20

writeEncodedAt

function writeEncodedAt(address, encoded)

Write encoded metadata into a RECORD_SIZE native record.

Parameter Type Default Description
address dynamic — Value supplied for address.
encoded dynamic — Value supplied for encoded.

Source: std/concurrent/shared_value.ml:197

writeI64At

function writeI64At(address, value)

Store a signed 64-bit integer at an unmanaged address.

Parameter Type Default Description
address dynamic — Value supplied for address.
value dynamic — Value to process.

Source: std/concurrent/shared_value.ml:132