Fix unused variable warning of GCC
[openssl.git] / doc / memory.doc
1 In the interests of debugging SSLeay, there is an option to compile
2 using some simple memory leak checking.
3
4 All malloc(), free() and realloc() calls in SSLeay now go via
5 Malloc(), Free() and Realloc() (except those in crypto/lhash).
6
7 If CRYPTO_MDEBUG is defined, these calls are #defined to
8 CRYPTO_malloc(), CRYPTO_free() and CRYPTO_realloc().
9 If it is not defined, they are #defined to malloc(), free() and realloc().
10
11 the CRYPTO_malloc() routines by default just call the underlying library
12 functons.
13
14 If CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) is called, memory leak detection is
15 turned on.  CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) turns it off.
16
17 When turned on, each Malloc() or Realloc() call is recored along with the file
18 and line number from where the call was made.   (This is done using the
19 lhash library which always uses normal system malloc(3) routines).
20
21 void CRYPTO_mem_leaks(BIO *b);
22 void CRYPTO_mem_leaks_fp(FILE *fp);
23 These both print out the list of memory that has not been free()ed.
24 This will probably be rather hard to read, but if you look for the 'top level'
25 structure allocation, this will often give an idea as to what is not being
26 free()ed.  I don't expect people to use this stuff normally.
27