Go to the documentation of this file.
47 #pragma warning( disable : 4127)
48 #pragma warning( disable : 4706)
52 void qh_fprintf(FILE *fp,
int msgcode,
const char *
fmt, ... );
62 qhmemT qhmem= {0,0,0,0,0,0,0,0,0,0,0,
63 0,0,0,0,0,0,0,0,0,0,0,
81 return(*((
const int *)i) - *((
const int *)j));
116 void **freelistp, *newbuffer;
118 int outsize, bufsize;
122 qh_fprintf(
qhmem.
ferr, 6235,
"qhull error (qh_memalloc): negative request size (%d). Did int overflow due to high-D?\n", insize);
130 if ((
object= *freelistp)) {
133 *freelistp= *((
void **)*freelistp);
148 if (!(newbuffer=
qh_malloc((
size_t)bufsize))) {
149 qh_fprintf(
qhmem.
ferr, 6080,
"qhull error (qh_memalloc): insufficient memory to allocate short memory buffer (%d bytes)\n", bufsize);
179 qh_fprintf(
qhmem.
ferr, 6081,
"qhull internal error (qh_memalloc): qhmem has not been initialized.\n");
187 if (!(
object=
qh_malloc((
size_t)outsize))) {
188 qh_fprintf(
qhmem.
ferr, 6082,
"qhull error (qh_memalloc): insufficient memory to allocate %d bytes\n", outsize);
204 int i, count, totfree= 0;
212 qh_fprintf(
qhmem.
ferr, 8143,
"qh_memcheck: check size of freelists on qhmem\nqh_memcheck: A segmentation fault indicates an overwrite of qhmem\n");
215 for (
object=
qhmem.
freelists[i];
object;
object= *((
void **)
object))
224 qh_fprintf(
qhmem.
ferr, 8144,
"qh_memcheck: total size of freelists totfree is the same as qhmem.totfree\n", totfree);
258 *((
void **)
object)= *freelistp;
289 void *buffer, *nextbuffer;
295 nextbuffer= *((
void **) buffer);
324 if (
sizeof(
void*) <
sizeof(
int)) {
325 qh_fprintf(
qhmem.
ferr, 6083,
"qhull internal error (qh_meminit): sizeof(void*) %d < sizeof(int) %d. qset.c will not work\n", (
int)
sizeof(
void*), (
int)
sizeof(
int));
328 if (
sizeof(
void*) >
sizeof(
ptr_intT)) {
329 qh_fprintf(
qhmem.
ferr, 6084,
"qhull internal error (qh_meminit): sizeof(void*) %d > sizeof(ptr_intT) %d. Change ptr_intT in mem.h to 'long long'\n", (
int)
sizeof(
void*), (
int)
sizeof(
ptr_intT));
354 qh_fprintf(
qhmem.
ferr, 6085,
"qhull internal error (qh_meminit): memory alignment %d is not a power of 2\n", alignment);
358 qhmem.
freelists= (
void **) calloc((
size_t)numsizes,
sizeof(
void *));
364 qh_fprintf(
qhmem.
ferr, 8059,
"qh_meminitbuffers: memory initialized with alignment %d\n", alignment);
379 qh_fprintf(
qhmem.
ferr, 6087,
"qhull error (qh_memsetup): largest mem size %d is >= buffer size %d or initial buffer size %d\n",
438 %7d quick allocations\n\
439 %7d short allocations\n\
440 %7d long allocations\n\
443 %7d bytes of short memory in use\n\
444 %7d bytes of short memory in freelists\n\
445 %7d bytes of dropped short memory\n\
446 %7d bytes of unused short memory (estimated)\n\
447 %7d bytes of long memory allocated (max, except for input)\n\
448 %7d bytes of long memory in use (in %d pieces)\n\
449 %7d bytes of short memory buffers (minus links)\n\
450 %7d bytes per short memory buffer (initially %d bytes)\n",
458 qh_fprintf(fp, 9279,
"%7d calls to qh_setlarger\n%7.2g average copy size\n",
460 qh_fprintf(fp, 9280,
" freelists(bytes->count):");
464 for (
object=
qhmem.
freelists[i];
object;
object= *((
void **)
object))
486 if (!(
object=
qh_malloc((
size_t)insize))) {
523 if (
sizeof(
void*) <
sizeof(
int)) {
524 qh_fprintf(
qhmem.
ferr, 6091,
"qhull internal error (qh_meminit): sizeof(void*) %d < sizeof(int) %d. qset.c will not work\n", (
int)
sizeof(
void*), (
int)
sizeof(
int));
529 void qh_meminitbuffers(
int tracelevel,
int alignment,
int numsizes,
int bufsize,
int bufinit) {
545 %7d long allocations\n\
547 %7d bytes of long memory allocated (max, except for input)\n\
548 %7d bytes of long memory in use (in %d pieces)\n",
568 void qh_memtotal(
int *totlong,
int *curlong,
int *totshort,
int *curshort,
int *maxlong,
int *totbuffer) {
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, int bufsize, int bufinit)
void qh_memtotal(int *totlong, int *curlong, int *totshort, int *curshort, int *maxlong, int *totbuffer)
void qh_memfreeshort(int *curlong, int *totlong)
void qh_memsize(int size)
void qh_meminit(FILE *ferr)
void qh_fprintf(FILE *fp, int msgcode, const char *fmt,...)
void * qh_malloc(size_t size)
void * qh_memalloc(int insize)
static int qh_intcompare(const void *i, const void *j)
void qh_errexit(int exitcode, facetT *, ridgeT *)
void qh_memfree(void *object, int insize)
void qh_exit(int exitcode)
void qh_memstatistics(FILE *fp)
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58