home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / chunk.h < prev    next >
Text File  |  1991-10-19  |  1KB  |  31 lines

  1. /*
  2.     chunk.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <objc/zone.h>
  8. /*
  9.  *  NXChunks implement variable sized arrays of records.  Allocation is by
  10.  *  the given size (in bytes) --- typically a multiple number of records, say 10.
  11.  *  The block of memory never shrinks, and the chunk records the current number
  12.  *  of elements.  To use the NXChunks, you declare a struct w/ NXChunk as its
  13.  *  first field.
  14.  */
  15.  
  16. typedef struct _NXChunk {
  17.     short           growby;    /* increment to grow by */
  18.     int             allocated;    /* how much is allocated */
  19.     int             used;    /* how much is used */
  20. } NXChunk;
  21.  
  22. extern NXChunk *NXChunkMalloc(int growBy, int initUsed);
  23. extern NXChunk *NXChunkRealloc(NXChunk *pc);
  24. extern NXChunk *NXChunkGrow(NXChunk *pc, int newUsed);
  25. extern NXChunk *NXChunkCopy(NXChunk *pc, NXChunk *dpc);
  26.  
  27. extern NXChunk *NXChunkZoneMalloc(int growBy, int initUsed, NXZone *zone);
  28. extern NXChunk *NXChunkZoneRealloc(NXChunk *pc, NXZone *zone);
  29. extern NXChunk *NXChunkZoneGrow(NXChunk *pc, int newUsed, NXZone *zone);
  30. extern NXChunk *NXChunkZoneCopy(NXChunk *pc, NXChunk *dpc, NXZone *zone);
  31.