---
name: "wn_f_free"
section: "3"
platform: "linux"
package: "libwn-dev"
version: "6.0-17"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/wnmlc"
---

# wn\_f\_free(3)

simple substitutions for malloc calls

Part of [wnmlc(3)](/wnmlc/3.md).

## NAME

wn\_f\_malloc, wn\_f\_calloc, wn\_f\_free, wn\_f\_cfree - simple substitutions for malloc calls

## SYNOPSIS

```
#include <wn/wnmlc.h>

char *wn_f_malloc(size)
unsigned int size;

char *wn_f_calloc(nelem,elsize)
unsigned int nelem,elsize;

wn_f_free(p)
char *p;

wn_f_cfree(p)
char *p;
```

## DESCRIPTION

These calls allow mechanical replacement of [malloc(3)](/malloc/3.md) calls by calls based on wnmem.  Simply add the prefix "wn\_f\_" to all malloc calls.

Doing so gives the following advantages:

\- Less paging.

\- Debugging using wn\_memd calls works.

Memory allocated using these calls comes from a general\_free memory group, labeled as "wn\_f\_malloc\_group".

Use of these calls should be only a first step in replacing all [malloc(3)](/malloc/3.md) calls with wn\_mem calls.

## DIAGNOSTICS

Same as wnmem.

## SEE ALSO

wnmem, wnmemd, [malloc(3)](/malloc/3.md)

## AUTHOR

Will Naylor
