⚡ fonksiyon
mmap_read
fonksiyon mmap_read
Memory-map a file for read-only access (zero-copy I/O).
Dosyayı salt-okunur erişim için belleğe eşle (sıfır-kopya I/O).
Parameters / Parametreler
path: Path to file / Dosya yolu
Returns / Dönüş Değeri
Returns memory-mapped file handle, or error. Belleğe eşlenmiş dosya handle'ını döner, veya hata.
Example / Örnek
// Ultra-fast file reading (no copying)
değişken mmap = io.mmap_read("huge_file.dat")?
// Access bytes directly via pointer
yazdır("File size: {mmap.length} bytes")
io.munmap(mmap)? // Always unmap when done!
Performance / Performans
O(1) - No data copying, OS maps file to virtual memory. 10-100x faster for large files. O(1) - Veri kopyalama yok, OS dosyayı sanal belleğe eşler. Büyük dosyalar için 10-100x daha hızlı.