# 使用 Homebrew, MacPorts, Nix, apt 安装 dmalloc

查看 dmalloc 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:dmalloc
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install dmalloc
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install dmalloc
```

  证据: MacPorts ports tree: devel/dmalloc/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#dmalloc
```

  证据: nixpkgs package indexes: pkgs/by-name/dm/dmalloc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- Debian apt (92%):

```sh
sudo apt install libdmalloc-dev
```

  证据: Debian stable package indexes: libdmalloc-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## 软件包事实

- **软件包键:** brew:dmalloc
- **软件包管理器:** Homebrew
- **版本:** 5.6.5
- **来源摘要:** Debug versions of system memory management routines
- **主页:** <https://dmalloc.com/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- dmalloc (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 5.6.5
## 项目历史与用法

Dmalloc is Gray Watson's debug memory allocation library, designed as a drop-in replacement for malloc, realloc, calloc, free, and related routines while adding runtime-configurable memory debugging.

### 项目历史

The manual carries copyright years from 1992 to 2020 and identifies version 5.6.5 as a December 2020 release. Its feature set reflects a long-lived C debugging niche: leak tracking, fence-post write detection, file and line reporting, statistics logging, and threaded-program support.

### 采用历史

Dmalloc's official documentation lists successful use across a wide range of Unix and non-Unix systems, including AIX, the BSDs, GNU/Hurd, HP-UX, IRIX, Linux, macOS, NeXT, OSF/DUX, SCO, Solaris, Ultrix, UnixWare, Windows, and Unicos on a Cray T3E.

### 使用方式

Typical use links the dmalloc library into a C or C++ program, optionally includes dmalloc.h for file and line reporting, and uses the dmalloc utility plus the DMALLOC_OPTIONS environment variable to enable checks such as leak logging, heap verification, and abort-on-error behavior.

### 为什么软件包爱好者会关心

Dmalloc is historically interesting because it predates many modern sanitizers yet remains a compact, portable package-manager answer for C heap debugging. Its shell integration, runtime token model, and static-library workflow make it feel like classic Unix debugging infrastructure.

### 时间线

- 1992: Earliest copyright year in the official manual.
- 2020-12: Dmalloc manual identifies version 5.6.5.

### Related projects

- Dmalloc sits in the same practical debugging space as allocator wrappers, leak checkers, and compiler/runtime sanitizers, but its official documentation focuses on replacing the standard allocation routines directly.

### 来源

- <https://dmalloc.com/>
- <https://dmalloc.com/docs/dmalloc.html>
- <https://github.com/j256/dmalloc>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - libdmalloc-dev - 5.5.2-14+b3: normalized package name match | Debian stable package indexes: libdmalloc-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | debug memory allocation library (development files and doc) | http://dmalloc.com/
- Debian apt - libdmalloc5 - 5.5.2-14+b3: normalized package name match | Debian stable package indexes: libdmalloc5 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | debug memory allocation library | http://dmalloc.com/
- Nix - dmalloc: normalized package name match | nixpkgs package indexes: pkgs/by-name/dm/dmalloc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libdmalloc-dev - 5.5.2-14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libdmalloc-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | debug memory allocation library (development files and doc) | http://dmalloc.com/
- Ubuntu apt - libdmalloc5 - 5.5.2-14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libdmalloc5 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | debug memory allocation library | http://dmalloc.com/
- MacPorts - dmalloc: normalized package name match | MacPorts ports tree: devel/dmalloc/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/dmalloc.yml](https://github.com/mxcl/pkgdb/blob/main/combined/dmalloc.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
