FIND YOUR NEXT FEW LINES

Results for “Dynamic memory & ownership”

Small, practical examples. Search by task or narrow things down below.

64 snippets foundClear filters
RustGetting Started

Borrow text without transferring ownership

Borrow text without transferring ownership in a complete Rust program using the standard library.

Rust✓ Tested
Linux CommandsSystem information

Check memory usage

Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.

memory✓ Tested
jQueryEvents

Handle dynamically added buttons

Delegate a jQuery event from a stable parent to later children.

jQuery✓ Tested
Arduino / CText & bounded buffers

Keep a serial message in flash memory

Arduino / C: The F macro keeps a literal out of scarce SRAM.

Arduino / C✓ Tested
Arduino / CGetting Started

Keep fixed text in flash memory

Arduino / C: Keep fixed text in flash memory on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
C++Ownership & optional values

Observe shared ownership without extending its lifetime

C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.

C++✓ Tested
PythonStructured data & serialization

Parse quoted CSV from an in-memory string

Python: Use StringIO with csv.reader so quoted commas are handled correctly.

Python✓ Tested
JavaText validation & formatting

Process the lines of an in-memory string

Java: Use String.lines to handle common line terminators without retaining them.

Java✓ Tested
RustTesting & reusable patterns

Read bytes through an in-memory cursor

Read bytes through an in-memory cursor in a complete Rust program using the standard library.

Rust✓ Tested
GoFiles & paths

Read from an in-memory filesystem

Read from an in-memory filesystem using a complete Go program with explicit sample inputs.

Go✓ Tested
Docker / ComposeStorage & isolation

Set and inspect a memory limit

Apply a per-container limit when creating a container.

memory✓ Tested
Docker / ComposeDockerfile patterns

Set copied files’ numeric ownership

Docker / Compose: COPY --chown sets ownership while adding the file.

Docker / Compose✓ Tested