home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / libdwarf / pro_alloc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.5 KB  |  68 lines

  1. /*
  2.  
  3.     This is the allocator and deallocator for
  4.     dwarf producer.
  5.  
  6.     Part of this interface is defined in the public interface.
  7.     Part is hidden in libdwarf.
  8.  
  9.     Goals: 
  10.         Fast allocation
  11.          no leakage on dwarf_finish() kinds of activities
  12.         match libdwarf documented semantics and space
  13.             rules
  14.         For producer, when dwarf_transform_to_disk_form()
  15.             is about finished, wants
  16.              all trees to disappear leaving only
  17.             byte streams.
  18.  
  19.     Producer special case:
  20.         After transform_to_disk_form is called we want
  21.         to have freed all die, attributes etc and just
  22.         leave the transformed byte streams and whatever
  23.         else is needed to support them.
  24.         So we invent a special free operation to do this.
  25.  
  26.     Issue: What to do if we discover problems in the arena when
  27.         deallocating?  These return nothing....
  28.  
  29.     We will allocate space in blocks attached to a Dwarf_Debug,
  30.         or, if no such thing present, to a special chain.
  31.         We can clear the special chain when the last Dwarf_Debug
  32.     is freed.
  33.  
  34.     Initial version is a hack.
  35.  
  36.     dwarf_alloc.c
  37.     $Revision: 1.1 $   $Date: 1993/07/19 22:33:52 $
  38.     
  39.  
  40. */
  41.  
  42. #include <stdlib.h>
  43. #include "dwarf_incl.h"
  44. #include "bstring.h"
  45.  
  46. /*
  47.     The allocator wants to know which region
  48.     this is to be in so it can allocate the new space
  49.     with respect to the right region.
  50. */
  51. Dwarf_Ptr _dwarf_p_get_alloc (
  52.     Dwarf_P_Debug     dbg,
  53.     Dwarf_Unsigned     size
  54. )
  55. {
  56.     void *sp;
  57.  
  58.     sp = malloc(size);
  59.     bzero(sp,(int)size);
  60.     return sp;
  61. }
  62.  
  63.  
  64. void dwarf_p_dealloc(void *space, Dwarf_Unsigned typ)
  65. {
  66.     return;
  67. }
  68.