MemoryMapped API Reference

Introduction

The memory-mapped API provides a way to represent memory addresses for efficient data access. It enables faster memory operations and simplifies data management by allowing for direct pointer manipulation.

Key Concepts

- Memory Mapping: Creates a direct mapping between physical memory addresses and virtual addresses.

- Memory Pointers: Represent the address of a specific memory location. They're used to access data.

- Virtual Address: The address space used by a process to access data.

Memory-Mapped Access

- When a memory address is memory-mapped, the system accesses data using the virtual address.

- It's particularly beneficial for accessing the same data from multiple processes or threads, improving performance.

Example - Loading a Vector

Let's imagine we have a vector (array) of 10 numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. We want to load this into memory-mapped memory.

The memory-mapped address will be similar to:

0x1000

Accessing data using this address will be extremely fast.

Interaction - Linking to a file

We will test this with a linked file called 'example.dat' which contains 10 numbers.

The value will be read at

0x1000

Conclusion

Memory-mapped access offers significant advantages in performance for data-intensive applications.