### Method

# Vips Source map

#### Declaration [src]

    void*
    vips_source_map (
      VipsSource* source,
      size_t* length
    )

#### Description [src]

Map the source entirely into memory and return a pointer to the start. If `length` is non-NULL, the source size is written to it.

This operation can take a long time. Use `vips_source_is_mappable()` to check if a source can be mapped efficiently.

The pointer is valid for as long as `source` is alive.

#### Parameters

`length`

  Type: `size_t*`

  Return the file length here, or `NULL`.

  The data is owned by the caller of the method.

#### Return value

Type: `void*`

A pointer to the start of the file contents, or `NULL` on error.

The returned data is owned by the instance.
The return value can be `NULL`.