ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/objutil.h
(Generate patch)

Comparing ray/src/common/objutil.h (file contents):
Revision 2.15 by greg, Fri Apr 9 15:26:41 2021 UTC vs.
Revision 2.18 by greg, Mon Mar 14 19:51:19 2022 UTC

# Line 181 | Line 181 | extern void    setMaterial(Scene *sc, const char *nm);
181   /* Add a new face to our scene, using current group and material */
182   extern Face *   addFace(Scene *sc, VNDX vid[], int nv);
183  
184 + /* Get neighbor vertices: malloc array with valence in index[0] */
185 + extern int *    getVertexNeighbors(Scene *sc, int vid);
186 +
187   /* Expand bounding box min & max (initialize bbox to all zeroes) */
188   extern int      growBoundingBox(Scene *sc, double bbox[2][3],
189                                          int flreq, int flexc);
# Line 200 | Line 203 | extern int     findName(const char *nm, const char **nmlis
203   /* Verbose mode global */
204   extern int      verbose;
205  
206 < extern char     *emalloc(unsigned int n);
207 < extern char     *ecalloc(unsigned int ne, unsigned int n);
208 < extern char     *erealloc(char *cp, unsigned int n);
209 < extern void     efree(char *cp);
206 > extern void     *emalloc(unsigned int n);
207 > extern void     *ecalloc(unsigned int ne, unsigned int n);
208 > extern void     *erealloc(void *ptr, unsigned int n);
209 > extern void     efree(void *ptr);
210  
211   #define getGroupID(sc,nm)       findName(nm, (const char **)(sc)->grpname, (sc)->ngrps)
212   #define getMaterialID(sc,nm)    findName(nm, (const char **)(sc)->matname, (sc)->nmats)
213  
214 < #define CHUNKSIZ        128     /* object allocation chunk size */
214 > #define CHUNKBITS       7               /* object allocation chunk bits */
215 > #define CHUNKSIZ        (1<<CHUNKBITS)  /* object allocation chunk size */
216  
217   #define chunk_alloc(typ, arr, nold) \
218 <                ((nold)%CHUNKSIZ ? (arr) : \
219 <                (typ *)erealloc((char *)(arr), sizeof(typ)*((nold)+CHUNKSIZ)))
218 >                ((nold)&(CHUNKSIZ-1) ? (arr) : \
219 >                (typ *)erealloc(arr, sizeof(typ)*((nold)+CHUNKSIZ)))
220  
221   #ifdef __cplusplus
222   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines