---
name: "lbRegisterArray"
section: "3"
platform: "linux"
package: "libleakbug-dev"
version: "0.1.5+debian-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/lbRegisterArray"
---

# lbRegisterArray(3)

Registers memory in an array for leakbug to keep track of.

## NAME

lbRegisterArray - Registers memory in an array for leakbug to keep track of.

## SYNOPSIS

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

**void \*\*lbRegisterArray(void \*\*ptr, unsigned int dataSize, unsigned int numElements, const char \*filename, int line, int debug\_level);**

## PARAMETERS

- **ptr**

  The array pointer to register.

- **dataSize**

  The size of the data.

- **numElements**

  The number of elements in the array.

- **filename**

  The calling filename.

- **line**

  The calling line number.

- **debug\_level**

  The debug level.

## DESCRIPTION

This is used to register any memory not automatically handled by leakbug. This is useful when leakbug dumps "Freeing unknown memory" warnings in your program.

 **#ifdef WITH\_LEAKBUG**\
    **#include \<leakbug.h\>**\
    **#define LB\_REGISTER\_ARRAY(ptr, dataSize, numElements) \\**\
       **lbRegisterArray((ptr), (dataSize), (numElements), \_\_FILE\_\_, \_\_LINE\_\_, \\**\
                       **LEAKBUG\_DEBUG\_LEVEL)**\
  **#else**\
    **#define LB\_REGISTER\_ARRAY(ptr, dataSize, numElements)**\
  **#endif**

## RETURNS

The array pointer passed.

## SEE ALSO

[lbRegister(3)](/lbRegister/3.md)
