memoverlap(3pub)

memoverlap3pub

Check whether two memory blocks overlap

Usage

#include <publib.h>
int memoverlap(const void *t, size_t ts, const void *s, size_t ss);

Overview

memoverlap checks whether the memory blocks t--(t+ts-1) and s--(s+ss-1) overlap. Neither pointer argument may be NULL, but the sizes may be 0. The memory blocks can be arbitrary, they do not have to be part of the same array. Therefore, this function hides the unportable pointer comparison that one would otherwise rely on.

Return value

memoverlap returns 0 if the blocks do not overlap, and nonzero if they do.

Releases

16 releases since Debian 1.2 (Rex); the text changed 4 times.

  1. 1.2–1.3
  2. 2.0–2.2
  3. 3.0
  4. 3.1–6.0
  5. 7–13

Author

Lars Wirzenius ([email protected])

From publib-dev 0.40-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.