fn copy_bytes_from_pdfium(&self, ptr: usize, len: usize) -> Vec<u8> {
        log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): entering");

        log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): copying {} bytes from pointer offset {}", len, ptr);

        let copy = self
            .heap_u8()
            .slice(ptr as u32, (ptr + len) as u32)
            .to_vec();

        if self.debug {
            let mut differences_count = 0;

            let pdfium_heap = self.heap_u8();

            for (index, byte) in copy.iter().enumerate() {
                let src = pdfium_heap.get_index((ptr + index) as u32);

                if *byte != src {
                    differences_count += 1;

                    log::warn!(
                        "pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): byte index {} differs between source and destination: source data = {}, destination data = {}",
                        index,
                        src,
                        byte,
                    );
                }
            }

            log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): {} bytes differ between source and destination byte buffers", differences_count);
        }

        log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): leaving");

        copy
    }
/// Copies bytes from the given pointer address in Pdfium's memory heap into our memory
/// heap, returning an address to the location in our memory heap where the first copied
/// byte was placed.
///
/// WASM modules are isolated from one another and cannot directly share memory. We must
/// therefore copy buffers from Pdfium's memory heap across into our own, and vice versa.
Copies bytes from the given pointer address in Pdfium's memory heap into our memory
heap, returning an address to the location in our memory heap where the first copied
byte was placed.

WASM modules are isolated from one another and cannot directly share memory. We must
therefore copy buffers from Pdfium's memory heap across into our own, and vice versa.
Copies bytes from the given pointer address in Pdfium ' s memory heap into our memory heap returning an address to the location in our memory heap where the first copied byte was placed . WASM modules are isolated from one another and cannot directly share memory . We must therefore copy buffers from Pdfium ' s memory heap across into our own and vice versa .
fn copy_bytes_from_pdfium(&self, ptr: usize, len: usize) -> Vec<u8> {
        log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): entering");
        log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): copying {} bytes from pointer offset {}", len, ptr);
        let copy = self
            .heap_u8()
            .slice(ptr as u32, (ptr + len) as u32)
            .to_vec();
        if self.debug {
            let mut differences_count = 0;
            let pdfium_heap = self.heap_u8();
            for (index, byte) in copy.iter().enumerate() {
                let src = pdfium_heap.get_index((ptr + index) as u32);
                if *byte != src {
                    differences_count += 1;
                    log::warn!(
                        "pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): byte index {} differs between source and destination: source data = {}, destination data = {}",
                        index,
                        src,
                        byte,
                    );
                }
            }
            log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): {} bytes differ between source and destination byte buffers", differences_count);
        }
        log::debug!("pdfium-render::PdfiumRenderWasmState::copy_bytes_from_pdfium(): leaving");
        copy
    }
fn copy_bytes_from_pdfium ( & self , ptr : usize , len : usize ) -> Vec < u8 > { log :: debug ! ( " " ) ; log :: debug ! ( " " len ptr ) ; let copy = self . heap_u8 ( ) . slice ( ptr as u32 , ( ptr + len ) as u32 ) . to_vec ( ) ; if self . debug { let mut differences_count = 0 ; let pdfium_heap = self . heap_u8 ( ) ; for ( index , byte ) in copy . iter ( ) . enumerate ( ) { let src = pdfium_heap . get_index ( ( ptr + index ) as u32 ) ; if * byte != src { differences_count += 1 ; log :: warn ! ( " " index src byte ) ; } } log :: debug ! ( " " differences_count ) ; } log :: debug ! ( " " ) ; copy }
Copies bytes from the given pointer address in Pdfium's memory heap into our memory
heap, returning an address to the location in our memory heap where the first copied
byte was placed.
Copies bytes from the given pointer address in Pdfium ' s memory heap into our memory heap returning an address to the location in our memory heap where the first copied byte was placed .
&self
ptr
usize
len
usize
&self
ptr
usize
len
usize