Changes between Version 1 and Version 2 of zzuf/internals


Ignore:
Timestamp:
11/22/2009 05:18:50 PM (15 years ago)
Author:
Sam Hocevar
Comment:

memory functions

Legend:

Unmodified
Added
Removed
Modified
  • zzuf/internals

    v1 v2  
    3333#!c
    3434#include <malloc.h>
     35
    3536#include "libzzuf.h"
    3637#include "lib-load.h"
     
    5657}}}
    5758
     59== Memory functions ==
     60
     61Functions such as '''`malloc`''' need to be diverted by zzuf in order to monitor global memory usage and detect severe memory leaks.
     62
     63This creates a bootstrapping problem on some platforms: the diverted '''`calloc`''' calls the real '''`calloc`''', which needs to be loaded using '''`dlsym`'''. On Linux, '''`dlsym`''' calls '''`calloc`''', resulting in an infinite loop. To avoid this, we declare a private static buffer that memory allocation functions can use if the original function is not yet loaded.
     64
    5865=== Standard file descriptor functions ===
    5966