38 1, 3, 5, 11, 17, 37, 67, 131, 257, 521,
39 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309,
40 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459,
49 EHash *eh = allocatorIFC->
alloc(allocator,
sizeof(*eh));
68 while (numBuckets--) {
74 freeEntry(entry, userData);
99 while (numBuckets--) {
100 for (entry = oldBuckets[numBuckets]; entry;) {
121 for (; (entry = *prevp); prevp = (
void **)&entry->next) {
122 if (entry->key == key) {
123 *prevp_r = (
void **)prevp;
137 if (entry->
key == key) {
192 return MEM_mallocN(numBytes,
"CCG standard alloc");
224 #ifdef DUMP_RESULT_GRIDS
233 for (i = 0, index = 0; i < ss->
vMap->
curSize; i++) {
235 for (;
v;
v =
v->next, index++) {
237 printf(
"vertex index=%d, co=(%f, %f, %f)\n", index, co[0], co[1], co[2]);
241 for (i = 0, index = 0; i < ss->
eMap->
curSize; i++) {
243 for (;
e;
e =
e->next, index++) {
246 printf(
"edge index=%d, start_co=(%f, %f, %f)\n", index, co[0], co[1], co[2]);
247 for (
x = 0;
x < edgeSize;
x++) {
249 printf(
"edge index=%d, seg=%d, co=(%f, %f, %f)\n", index,
x, co[0], co[1], co[2]);
252 printf(
"edge index=%d, end_co=(%f, %f, %f)\n", index, co[0], co[1], co[2]);
256 for (i = 0, index = 0; i < ss->
fMap->
curSize; i++) {
258 for (; f; f = f->
next, index++) {
262 printf(
"face index=%d, vertex=%d, coord=(%f, %f, %f)\n", index, S, co[0], co[1], co[2]);
267 for (i = 0, index = 0; i < ss->
fMap->
curSize; i++) {
269 for (; f; f = f->
next, index++) {
274 printf(
"face index=%d, edge=%d, coord1=(%f, %f, %f), coord2=(%f, %f, %f)\n",
287 for (i = 0, index = 0; i < ss->
fMap->
curSize; i++) {
289 for (; f; f = f->
next, index++) {
292 for (
x = 0;
x < gridSize;
x++) {
293 for (
y = 0;
y < gridSize;
y++) {
295 printf(
"face index=%d. corner=%d, x=%d, y=%d, coord=(%f, %f, %f)\n",
305 for (
x = 0;
x < gridSize;
x++) {
307 printf(
"face index=%d. corner=%d, ie_index=%d, coord=(%f, %f, %f)\n",
BLI_INLINE int ccg_edgesize(int level)
BLI_INLINE int ccg_gridsize(int level)
BLI_INLINE CCGEdge ** FACE_getEdges(CCGFace *f)
BLI_INLINE CCGVert ** FACE_getVerts(CCGFace *f)
#define EHASH_alloc(eh, nb)
#define EDGE_getCo(e, lvl, x)
#define FACE_getIFCo(f, lvl, S, x, y)
#define EHASH_free(eh, ptr)
#define VERT_getCo(v, lvl)
void(* EHEntryFreeFP)(EHEntry *, void *)
#define EHASH_hash(eh, item)
#define FACE_getIECo(f, lvl, S, x)
void * ccg_ehash_lookupWithPrev(EHash *eh, void *key, void ***prevp_r)
void ccg_ehashIterator_init(EHash *eh, EHashIterator *ehi)
void ccg_ehashIterator_next(EHashIterator *ehi)
void * ccg_ehash_lookup(EHash *eh, void *key)
void ccg_ehash_insert(EHash *eh, EHEntry *entry)
static void * _stdAllocator_alloc(CCGAllocatorHDL UNUSED(a), int numBytes)
EHash * ccg_ehash_new(int estimatedNumEntries, CCGAllocatorIFC *allocatorIFC, CCGAllocatorHDL allocator)
void ccg_ehash_free(EHash *eh, EHEntryFreeFP freeEntry, void *userData)
void * ccg_ehashIterator_getCurrent(EHashIterator *ehi)
int ccg_ehashIterator_isStopped(EHashIterator *ehi)
CCGAllocatorIFC * ccg_getStandardAllocatorIFC(void)
static void _stdAllocator_free(CCGAllocatorHDL UNUSED(a), void *ptr)
static void * _stdAllocator_realloc(CCGAllocatorHDL UNUSED(a), void *ptr, int newSize, int UNUSED(oldSize))
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
void(* free)(CCGAllocatorHDL a, void *ptr)
void(* release)(CCGAllocatorHDL a)
void *(* realloc)(CCGAllocatorHDL a, void *ptr, int newSize, int oldSize)
void *(* alloc)(CCGAllocatorHDL a, int numBytes)
struct _EHEntry * curEntry
CCGAllocatorIFC allocatorIFC
CCGAllocatorHDL allocator