Up: Home page for Qhull (local)
Up: Qhull manual: contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace • Functions (local)
Up: Qhull code
To: Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

## mem_r.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-2020 C.B. Barber

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

### Index to mem_r.c and mem_r.h

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

### »mem_r.h data types and constants

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

### »mem_r.h macros

- qh_memalloc_ allocate memory
- qh_memfree_ free memory

### »User level functions

- qh_memalloc allocate memory
- qh_memcheck quick check of memory for internal consistency
- 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 (local)
Up: Qhull manual: contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace • Functions (local)
Up: Qhull code
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