---
name: "dwarf_pubtypes_dealloc"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/dwarf_dealloc"
---

# dwarf\_pubtypes\_dealloc(3)

release resources

Part of [dwarf\_dealloc(3)](/dwarf_dealloc/3.md).

## NAME

**dwarf\_dealloc**, **dwarf\_fde\_cie\_list\_dealloc**, **dwarf\_funcs\_dealloc**, **dwarf\_globals\_dealloc**, **dwarf\_pubtypes\_dealloc**, **dwarf\_ranges\_dealloc**, **dwarf\_srclines\_dealloc**, **dwarf\_types\_dealloc**, **dwarf\_vars\_dealloc**, **dwarf\_weaks\_dealloc** – release resources

## LIBRARY

library “libdwarf”

## SYNOPSIS

**#include \<libdwarf.h\>**

*void*\

**dwarf\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Ptr ptr*, *Dwarf\_Unsigned type*);

**dwarf\_fde\_cie\_list\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Cie \*cie\_list*, *Dwarf\_Signed cie\_count*, *Dwarf\_Fde \*fde\_list*, *Dwarf\_Signed fde\_count*);

*void*\

**dwarf\_funcs\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Func \*funcs*, *Dwarf\_Signed funccount*);

*void*\

**dwarf\_globals\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Global \*globals*, *Dwarf\_Signed globalcount*);

*void*\

**dwarf\_pubtypes\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Type \*pubtypes*, *Dwarf\_Signed pubtypecount*);

*void*\

**dwarf\_ranges\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Ranges \*ranges*, *Dwarf\_Signed rangecount*);

*void*\

**dwarf\_srclines\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Line \*lines*, *Dwarf\_Signed linecount*);

*void*\

**dwarf\_types\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Type \*types*, *Dwarf\_Signed typecount*);

*void*\

**dwarf\_vars\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Var \*vars*, *Dwarf\_Signed varcount*);

*void*\

**dwarf\_weaks\_dealloc**(*Dwarf\_Debug dbg*, *Dwarf\_Weak \*weaks*, *Dwarf\_Signed weakcount*);

## DESCRIPTION

The function **dwarf\_dealloc**() is used by applications to indicate that memory areas returned by library “libdwarf” may be safely disposed off. Due to the way memory is managed in the current implementation, the use of **dwarf\_dealloc**() is only necessary for a small set of DWARF types.

Argument *dbg* should reference a valid debugging context allocated using [dwarf\_init(3)](/dwarf_init/3.md).

Argument *ptr* should point to an object or memory area obtained by a prior call to a DWARF(3) function.

Argument *type* indicates the type of object being deallocated. The indicated type must match that of the object being passed in argument *ptr*. Valid values for the *type* argument are:

- DW\_DLA\_ABBREV

  An object of type *Dwarf\_Abbrev*, as returned by a call to the function [dwarf\_get\_abbrev(3)](/dwarf_get_abbrev/3.md).

- DW\_DLA\_DIE

  An object of type *Dwarf\_Die*, as returned by calls to the functions [dwarf\_child(3)](/dwarf_child/3.md), [dwarf\_offdie(3)](/dwarf_offdie/3.md) or [dwarf\_siblingof(3)](/dwarf_siblingof/3.md).

- DW\_DLA\_FRAME\_BLOCK

  An array of objects of type *Dwarf\_Frame\_op*, as returned by a call to the function [dwarf\_expand\_frame\_instructions(3)](/dwarf_expand_frame_instructions/3.md).

Calls to **dwarf\_dealloc**() with other values for argument *type* are no-ops in this implementation.

The functions **dwarf\_fde\_cie\_list\_dealloc**(), **dwarf\_funcs\_dealloc**(), **dwarf\_globals\_dealloc**(), **dwarf\_pubtypes\_dealloc**(), **dwarf\_ranges\_dealloc**(), **dwarf\_srclines\_dealloc**(), **dwarf\_types\_dealloc**(), **dwarf\_vars\_dealloc**() and **dwarf\_weaks\_dealloc**() are provided for compatibility with other implementations of the DWARF(3) API. Due to the way memory is managed in the current implementation, these functions are effectively no-ops.

See [dwarf(3)](/dwarf/3.md) for more information about the memory management scheme in this implementation of the DWARF(3) API.

## RETURN VALUES

Functions **dwarf\_dealloc**(), **dwarf\_fde\_cie\_list\_dealloc**(), **dwarf\_funcs\_dealloc**(), **dwarf\_globals\_dealloc**(), **dwarf\_pubtypes\_dealloc**(), **dwarf\_ranges\_dealloc**(), **dwarf\_srclines\_dealloc**(), **dwarf\_types\_dealloc**(), **dwarf\_vars\_dealloc**() and **dwarf\_weaks\_dealloc**() have no return value.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_child(3)](/dwarf_child/3.md), [dwarf\_expand\_frame\_instructions(3)](/dwarf_expand_frame_instructions/3.md), [dwarf\_get\_abbrev(3)](/dwarf_get_abbrev/3.md), [dwarf\_offdie(3)](/dwarf_offdie/3.md), [dwarf\_siblingof(3)](/dwarf_siblingof/3.md)
