Commit ea1de38
committed
Add PyBuffer tests, documentation, and examples
- test/py_buffer_SUITE.erl: Common Test suite with 13 tests for:
- Basic buffer creation (with/without content length)
- Write/read cycle, readline, readlines
- Seek/tell position tracking
- Fast find with memchr/memmem
- Zero-copy memoryview access
- Line iteration, closed/empty buffer handling
- Auto-conversion when passing buffer ref to Python
- GC and reference counting verification
- docs/buffer.md: Documentation covering:
- Erlang API (new, write, close)
- Python API (file-like methods, buffer protocol, find)
- Architecture diagram and memory layout
- Performance tips and examples
- examples/py_buffer_example.erl: Working escript demonstrating:
- Basic buffer usage
- HTTP body streaming simulation
- File-like interface methods
- Zero-copy memoryview access
- Line iteration for CSV-like data
- CHANGELOG.md: Added PyBuffer API entry under 2.2.0
- docs/getting-started.md: Added Zero-Copy Buffers section with
link to buffer.md1 parent de998a3 commit ea1de38
5 files changed
Lines changed: 1068 additions & 0 deletions
File tree
- docs
- examples
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
7 | 21 | | |
8 | 22 | | |
9 | 23 | | |
| |||
0 commit comments