void nfst_init_1d( nfst_plan *ths, int N0, int M_total) { int N[1]; N[0] = N0; nfst_init( ths, 1, N, M_total); }
void nfst_init_2d( nfst_plan *ths, int N0, int N1, int M_total) { int N[2]; N[0] = N0; N[1] = N1; nfst_init( ths, 2, N, M_total); }
void nfst_init_3d( nfst_plan *ths, int N0, int N1, int N2, int M_total) { int N[3]; N[0] = N0; N[1] = N1; N[2] = N2; nfst_init( ths, 3, N, M_total); }
qboolean Q_STInit(stable_t *st, uint32_t size, int32_t avgLength, int16_t memoryTag) { assert(st != NULL); st->tag = memoryTag; st->size = size; st->st = Z_TagMalloc(st->size, st->tag); if (!st->st) return false; nfst_init((struct nfst_StringTable *)st->st, st->size, avgLength); return true; }
qboolean Q_STInit(stable_t *st, int32_t avgLength) { if (!st->st) { st->st = Z_TagMalloc(st->size, TAG_SYSTEM); if (!st->st) return false; st->heap = true; } nfst_init((struct nfst_StringTable *)st->st, st->size, avgLength); return true; }
// Creates a new `ConfigData` object. The `realloc` function will be used for // allocating the data. `config_size` and `stringtable_size` specify the original size // of the config data and the string table data. You can use 0 for a default size. struct ConfigData *nfcd_make(nfcd_realloc realloc, void *ud, int config_size, int stringtable_size) { if (!config_size) config_size = 8*1024; if (!stringtable_size) stringtable_size = 8*1024; int total_bytes = config_size + stringtable_size; struct ConfigData *cd = (ConfigData*)realloc(ud, NULL, 0, total_bytes, __FILE__, __LINE__); cd->total_bytes = total_bytes; cd->allocated_bytes = config_size; cd->used_bytes = sizeof(*cd); cd->root = NFCD_TYPE_NULL; cd->realloc = realloc; cd->realloc_user_data = ud; nfst_init(STRINGTABLE(cd), stringtable_size, 15); return cd; }