Dmalloc Logo
Home

Documentation
Downloads
Forums
Releases

Search this site:

Donations:
If dmalloc has saved you or your company time or money, please use your credit-card or PayPal account to donate to the cause.

Dmalloc Tutorial: 5.3 Issues Important for Porting the Library
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3 Issues Important for Porting the Library

General portability issues center around:

  • mmap, sbrk, or compatible function usages. The library does support a preallocated memory chunk heap. See the INTERNAL_MEMORY_SPACE define in the `settings.dist' file.
  • The locating of the caller's address from the dmalloc functions. This is useful in locating problems from dmalloc functions called from C files which did not include `dmalloc.h': C library calls for instance.

    See `return.h' for the available architecture/compiler combinations. You may want to examine the assembly code from gcc (GNUs superior c-compiler) version 2+ being run on the following code. It should give you a good start on building a hack for your box.

     
    static char * x;
    
    a()
    {
            x = __builtin_return_address(0);
    }
    
    main()
    {
            a();
    }
    

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Gray Watson on May, 16 2007 using texi2html 1.76.

This work is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.
This page should be W3C Valid XHTML and should work with most browsers.