FIND YOUR NEXT FEW LINES

Results for “mem”

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

68 snippets foundClear filters
Linux CommandsArchive integrity & packaging

Read concatenated gzip members

Linux Commands: GNU gzip decompresses concatenated gzip members in order.

Linux Commands✓ 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
ReactRefs & DOM interaction

Remember the previously committed value

Remember the previously committed value with a small React component and explicit browser behavior.

React✓ Tested
Docker / ComposeStorage & isolation

Set and inspect a memory limit

Apply a per-container limit when creating a container.

memory✓ Tested
CStructures & function interfaces

Track which union member is currently valid

C: An explicit tag tells callers which overlaid union value to read.

C✓ Tested
CDynamic memory & ownership

Allocate an independent copy of a C string

C: Include one extra byte for the terminating null character.

C✓ Tested
CDynamic memory & ownership

Allocate and free a typed array

C: Use sizeof on the pointed-to type and check allocation success before writing.

C✓ Tested
CDynamic memory & ownership

Allocate and initialize a structure

C: Use a compound literal assignment to initialize all ordinary structure fields.

C✓ Tested
CDynamic memory & ownership

Check an array allocation size before multiplying

C: Compare the requested element count against SIZE_MAX divided by element size.

C✓ Tested
Arduino / CEEPROM & program memory

Check EEPROM capacity before a write

Arduino / C: length reports the available address count for this board.

Arduino / C✓ Tested
CDynamic memory & ownership

Clear an owning pointer after releasing its allocation

C: Assigning NULL helps prevent accidental reuse through the same variable.

C✓ Tested
Arduino / CEEPROM & program memory

Copy a flash string into a bounded RAM buffer

Arduino / C: strncpy_P reads from program memory into ordinary RAM.

Arduino / C✓ Tested