diff options
author | Carsten Haitzler <raster@rasterman.com> | 2008-10-20 03:30:22 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2008-10-20 03:30:22 +0000 |
commit | 406fefafe4af3db81a0129c18edb8bd64c9ef44f (patch) | |
tree | 54f4220a45fb213b1e15ccfd0868c4acc686135a /src | |
parent | 80d7215a246edf991f992b40c153c65729de5489 (diff) | |
download | enlightenment-406fefafe4af3db81a0129c18edb8bd64c9ef44f.tar.gz |
was using this for debugging. keep it there for future reference. didn't know
we had such malloc hooks! i might consider using these in future!
SVN revision: 36831
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/e_main.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/bin/e_main.c b/src/bin/e_main.c index e72008c966..0b46ebe043 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -7,6 +7,53 @@ #include <Ecore_IMF.h> #endif +/* + * i need to make more use of these when i'm baffled as to when something is + * up. other hooks: + * + * void *(*__malloc_hook)(size_t size, const void *caller); + * + * void *(*__realloc_hook)(void *ptr, size_t size, const void *caller); + * + * void *(*__memalign_hook)(size_t alignment, size_t size, + * const void *caller); + * + * void (*__free_hook)(void *ptr, const void *caller); + * + * void (*__malloc_initialize_hook)(void); + * + * void (*__after_morecore_hook)(void); + * + +static void my_init_hook(void); +static void my_free_hook(void *p, const void *caller); + +static void (*old_free_hook)(void *ptr, const void *caller) = NULL; +void (*__free_hook)(void *ptr, const void *caller); + +void (*__malloc_initialize_hook) (void) = my_init_hook; +static void +my_init_hook(void) +{ + old_free_hook = __free_hook; + __free_hook = my_free_hook; +} + +//void *magicfree = NULL; + +static void my_free_hook(void *p, const void *caller) +{ + __free_hook = old_free_hook; +// if ((p) && (p == magicfree)) +// { +// printf("CAUGHT!!!!! %p ...\n", p); +// abort(); +// } + free(p); + __free_hook = my_free_hook; +} +*/ + EAPI int e_precache_end = 0; /* local subsystem functions */ |