|
50 | 50 | partition_erase_range/2, partition_erase_range/3, |
51 | 51 | partition_list/0, |
52 | 52 | partition_read/3, |
| 53 | + partition_mmap/3, |
53 | 54 | partition_write/3, |
54 | 55 | rtc_slow_get_binary/0, |
55 | 56 | rtc_slow_set_binary/1, |
@@ -535,6 +536,23 @@ partition_list() -> |
535 | 536 | partition_read(_Partition_id, _Offset, _Read_size) -> |
536 | 537 | erlang:nif_error(undefined). |
537 | 538 |
|
| 539 | +%%----------------------------------------------------------------------------- |
| 540 | +%% @param partition_id The id of the partition to read from eg. "main.avm" |
| 541 | +%% @param offset Starting offset in bytes where to begin reading |
| 542 | +%% @param read_size Number of bytes to read |
| 543 | +%% @returns {ok, data} on success, error on failure |
| 544 | +%% @doc Read binary data from a specific partition at the given offset, |
| 545 | +%% mapping it in RAM. The partition is unmapped when all references |
| 546 | +%% are garbage collected. |
| 547 | +%% |
| 548 | +%% @end |
| 549 | +%%----------------------------------------------------------------------------- |
| 550 | +-spec partition_mmap( |
| 551 | + Partition_id :: binary(), Offset :: non_neg_integer(), Read_size :: non_neg_integer() |
| 552 | +) -> {ok, binary()} | error. |
| 553 | +partition_mmap(_Partition_id, _Offset, _Read_size) -> |
| 554 | + erlang:nif_error(undefined). |
| 555 | + |
538 | 556 | %%----------------------------------------------------------------------------- |
539 | 557 | %% @param partition_id The id of the partition to write to eg. "main.avm" |
540 | 558 | %% @param offset Starting offset in bytes where to begin writing |
|
0 commit comments