Up: Home page for Qhull
Up: Qhull manual: Table of Contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace
Up: Qhull code: Table of Contents
To: Qhull functions, macros, and data structures
To: Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

## mem.c -- memory operations

> Qhull uses quick-fit memory allocation. It maintains a set of free lists for a variety of small allocations. A small request returns a block from the best fitting free list. If the free list is empty, Qhull allocates a block from a reserved buffer.

> Use 'T5' to trace memory allocations.

Copyright © 1995-2010 C.B. Barber

» Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

### Index to mem.c and mem.h

- mem.h data types
- mem.h macros
- User level functions

### »mem.h data types and constants

- ptr_intT for casting a void* to an integer-type
- qhmemT global memory structure for mem.c
- qh_NOmem disable memory allocation

### »mem.h macros

- qh_memalloc_ allocate memory
- qh_memfree_ free memory

### »User level functions

- qh_memalloc allocate memory
- qh_memfree free memory
- qh_meminit initialize memory
- qh_memstatistics print memory statistics
- qh_memtotlong return total, allocated long memory
- qh_NOmem allocation routines with malloc() and free()

### »Initialization and termination functions

- qh_intcompare used by qsort and bsearch to compare two integers
- qh_memfreeshort frees up all short and qhmem memory allocations
- qh_meminit initialize memory
- qh_meminitbuffers initialize qhmem
- qh_memsetup set up memory after running memsize()
- qh_memsize define a free list for this size
- qh_memstatistics print out memory statistics

Up: Home page for Qhull
Up: Qhull manual: Table of Contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace
Up: Qhull code: Table of Contents
To: Qhull functions, macros, and data structures
To: Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

The Geometry Center Home Page

Comments to: qhull@qhull.org
Created: May 2, 1997 --- Last modified: see top