5050 partition_erase_range /2 , partition_erase_range /3 ,
5151 partition_list /0 ,
5252 partition_read /3 ,
53+ partition_mmap /3 ,
5354 partition_write /3 ,
5455 rtc_slow_get_binary /0 ,
5556 rtc_slow_set_binary /1 ,
@@ -522,7 +523,7 @@ partition_list() ->
522523
523524% %-----------------------------------------------------------------------------
524525% % @param partition_id The id of the partition to read from eg. "main.avm"
525- % % @param offset Starting offset in bytes where to begin reading
526+ % % @param offset Starting offset in the partition where to begin reading
526527% % @param read_size Number of bytes to read
527528% % @returns {ok, data} on success, error on failure
528529% % @doc Read binary data from a specific partition at the given offset.
@@ -535,9 +536,26 @@ partition_list() ->
535536partition_read (_Partition_id , _Offset , _Read_size ) ->
536537 erlang :nif_error (undefined ).
537538
539+ % %-----------------------------------------------------------------------------
540+ % % @param partition_id The id of the partition to read from eg. "main.avm"
541+ % % @param offset Starting offset in the partition 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+
538556% %-----------------------------------------------------------------------------
539557% % @param partition_id The id of the partition to write to eg. "main.avm"
540- % % @param offset Starting offset in bytes where to begin writing
558+ % % @param offset Starting offset in the partition where to begin writing
541559% % @param data Binary data to write to the partition
542560% % @returns ok on success, error on failure
543561% % @doc Writes binary data to a specific partition at the given offset.
0 commit comments