bin/ksh/alloc.c
88
return alloc(size, ap);
bin/ksh/c_ksh.c
92
fdir = dir = alloc(ilen + nlen + elen, ATEMP);
bin/ksh/emacs.c
1339
k = alloc(sizeof *k + count + 1, AEDIT);
bin/ksh/eval.c
1322
new = alloc(l1 + l2 + l3 + 1, ATEMP);
bin/ksh/eval.c
1351
cpy = alloc(sizeof(struct tbl), ATEMP);
bin/ksh/eval.c
319
newst = alloc(
bin/ksh/eval.c
445
debunk(alloc(len, ATEMP),
bin/ksh/expand.h
39
(xs).beg = alloc((xs).len + X_EXTRA, (xs).areap); \
bin/ksh/expr.c
568
vp = alloc(sizeof(struct tbl), ATEMP);
bin/ksh/io.c
448
tp = alloc(sizeof(struct temp) + len, ap);
bin/ksh/jobs.c
1524
newj = alloc(sizeof(Job), APERM);
bin/ksh/jobs.c
1551
p = alloc(sizeof(Proc), APERM);
bin/ksh/lex.c
733
struct ioword *iop = alloc(sizeof(*iop), ATEMP);
bin/ksh/lex.c
954
s = alloc(sizeof(Source), areap);
bin/ksh/mail.c
176
mbp = alloc(sizeof(mbox_t), APERM);
bin/ksh/main.c
214
confstr(_CS_PATH, new = alloc(len + 1, APERM), len + 1);
bin/ksh/main.c
712
ep = alloc(sizeof(*ep), ATEMP);
bin/ksh/misc.c
1011
char *str = alloc(max_width + 1, ATEMP);
bin/ksh/misc.c
102
ns = alloc(n + 1, ap);
bin/ksh/misc.c
1138
b = alloc(bsize, ATEMP);
bin/ksh/misc.c
509
alloc(len, ATEMP);
bin/ksh/misc.c
86
p = alloc(len, ap);
bin/ksh/sh.h
377
void * alloc(size_t, Area *);
bin/ksh/shf.c
107
shf->buf = alloc(bsize, ATEMP);
bin/ksh/shf.c
112
shf = alloc(sizeof(struct shf) + bsize, ATEMP);
bin/ksh/shf.c
195
shf = alloc(sizeof(struct shf), ATEMP);
bin/ksh/shf.c
203
buf = alloc(bsize, shf->areap);
bin/ksh/shf.c
44
shf = alloc(sizeof(struct shf) + bsize, ATEMP);
bin/ksh/syn.c
373
t->str = alloc(2, ATEMP);
bin/ksh/syn.c
575
t->left->args[0] = alloc(3, ATEMP);
bin/ksh/syn.c
580
t->left->vars = alloc(sizeof(char *), ATEMP);
bin/ksh/syn.c
752
t = alloc(sizeof(*t), ATEMP);
bin/ksh/table.c
137
p = alloc(offsetof(struct tbl, name[0]) + len,
bin/ksh/tree.c
443
r = alloc(sizeof(struct op), ap);
bin/ksh/tree.c
487
return memcpy(alloc(len, ap), wp, len);
bin/ksh/tree.c
624
q = alloc(sizeof(*p), ap);
bin/ksh/var.c
1155
new = alloc(sizeof(struct tbl) + namelen,
bin/ksh/var.c
51
l = alloc(sizeof(struct block), ATEMP);
bin/ksh/var.c
527
p = alloc(nlen + 1, ATEMP);
bin/ksh/var.c
583
xp = alloc(namelen + 1 + vallen, vp->areap);
bin/ksh/vi.c
1396
new = alloc(sizeof(struct edstate), APERM);
bin/ksh/vi.c
1397
new->cbuf = alloc(old->cbufsize, APERM);
bin/ksh/vi.c
752
nbuf = alloc(nlen + 1 + olen, APERM);
games/hack/def.gen.h
76
#define newgen() (struct gen *) alloc(sizeof(struct gen))
games/hack/def.gold.h
73
#define newgold() (struct gold *) alloc(sizeof(struct gold))
games/hack/def.monst.h
109
#define newmonst(xl) (struct monst *) alloc((unsigned)(xl) + sizeof(struct monst))
games/hack/def.obj.h
107
#define newobj(xl) (struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
games/hack/def.trap.h
75
#define newtrap() (struct trap *) alloc(sizeof(struct trap))
games/hack/def.wseg.h
73
#define newseg() (struct wseg *) alloc(sizeof(struct wseg))
games/hack/hack.end.c
72
#define newttentry() (struct toptenentry *) alloc(sizeof(struct toptenentry))
games/hack/hack.engrave.c
186
alloc((unsigned)(sizeof(struct engr) + len));
games/hack/hack.engrave.c
315
ep = (struct engr *) alloc((unsigned)(sizeof(struct engr) + len + 1));
games/hack/hack.engrave.c
366
ep = (struct engr *) alloc(sizeof(struct engr) + lth);
games/hack/hack.h
219
void *alloc(unsigned int);
games/hack/hack.h
97
#define newstring(x) (char *) alloc((unsigned)(x))
games/hack/hack.o_init.c
213
objects[i].oc_name = (char *) alloc(len);
games/hack/hack.o_init.c
219
objects[i].oc_descr = (char *) alloc(len);
games/hack/hack.o_init.c
225
objects[i].oc_uname = (char *) alloc(len);
games/hack/hack.pager.c
146
bufr = (char *) alloc((unsigned) CO);
games/hack/hack.pager.c
284
alloc((unsigned)(len + sizeof(struct line) + 1));
games/hack/hack.rumors.c
89
usedbits = (char *) alloc((unsigned)(i+1));
games/hack/hack.termcap.c
90
tptr = (char *) alloc(1024);
games/hack/hack.topl.c
126
alloc(sizeof(struct topl) + slen);
lib/libc/asr/gethostnamadr_async.c
572
size_t alloc;
lib/libc/asr/gethostnamadr_async.c
574
alloc = sizeof(*h) + 1024;
lib/libc/asr/gethostnamadr_async.c
575
if ((h = calloc(1, alloc)) == NULL)
lib/libfido2/src/blob.c
123
size_t alloc;
lib/libfido2/src/blob.c
127
if ((b->len = cbor_serialize_alloc(item, &b->ptr, &alloc)) == 0) {
lib/libutil/ohash.c
198
h->info.alloc = info->alloc;
lib/libutil/ohash.c
50
p = (i->alloc)(i->key_offset + (*end - start) + 1, i->data);
lib/libutil/ohash.h
32
void *(*alloc)(size_t, void *);
libexec/ld.so/library_subr.c
524
if (i == p->child_vec.alloc)
libexec/ld.so/library_subr.c
526
p->child_vec.alloc);
libexec/ld.so/library_subr.c
538
vec->alloc += more;
libexec/ld.so/library_subr.c
539
vec->vec = _dl_reallocarray(vec->vec, vec->alloc, sizeof(*vec->vec));
libexec/ld.so/library_subr.c
559
if (len >= vec->alloc)
libexec/ld.so/library_subr.c
561
vec->alloc);
libexec/ld.so/resolve.h
75
int alloc;
regress/lib/libssl/bytestring/bytestringtest.c
573
int alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
576
alloc = 1;
regress/lib/libssl/bytestring/bytestringtest.c
581
alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
593
alloc = 1;
regress/lib/libssl/bytestring/bytestringtest.c
597
alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
607
alloc = 1;
regress/lib/libssl/bytestring/bytestringtest.c
611
alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
621
alloc = 1;
regress/lib/libssl/bytestring/bytestringtest.c
626
alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
637
if (alloc)
regress/lib/libssl/bytestring/bytestringtest.c
782
int alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
799
alloc = 1;
regress/lib/libssl/bytestring/bytestringtest.c
802
alloc = 0;
regress/lib/libssl/bytestring/bytestringtest.c
826
if (alloc)
sbin/growfs/growfs.c
1253
bp[i].new = alloc() / sblock.fs_frag;
sbin/growfs/growfs.c
133
static daddr_t alloc(void);
sbin/newfs/mkfs.c
131
daddr_t alloc(int, int);
sbin/newfs/mkfs.c
804
node.dp1.di_db[0] = alloc(sblock.fs_fsize, node.dp1.di_mode);
sbin/newfs/mkfs.c
822
node.dp1.di_db[0] = alloc(sblock.fs_fsize, node.dp1.di_mode);
sbin/newfs/mkfs.c
862
node.dp2.di_db[0] = alloc(sblock.fs_fsize, node.dp2.di_mode);
sbin/newfs/mkfs.c
880
node.dp2.di_db[0] = alloc(sblock.fs_fsize, node.dp2.di_mode);
sbin/newfs_ext2fs/mke2fs.c
1130
alloc(sblock.e2fs_bsize, node.e2di_mode);
sbin/newfs_ext2fs/mke2fs.c
128
static uint32_t alloc(uint32_t, uint16_t);
sbin/newfs_ext2fs/mke2fs.c
929
node.e2di_blocks[0] = alloc(sblock.e2fs_bsize, node.e2di_mode);
sbin/newfs_ext2fs/mke2fs.c
935
blk = alloc(sblock.e2fs_bsize, 0);
sbin/newfs_ext2fs/mke2fs.c
975
node.e2di_blocks[0] = alloc(node.e2di_size, node.e2di_mode);
sbin/unwind/frontend.c
1007
reply_info_parsedelete(rinfo, &alloc);
sbin/unwind/frontend.c
1008
alloc_clear(&alloc);
sbin/unwind/frontend.c
1012
reply_info_parsedelete(rinfo, &alloc);
sbin/unwind/frontend.c
1013
alloc_clear(&alloc);
sbin/unwind/frontend.c
876
struct alloc_cache alloc;
sbin/unwind/frontend.c
881
alloc_init(&alloc, NULL, 0);
sbin/unwind/frontend.c
887
if (reply_info_parse(pq->abuf, &alloc, &qinfo, &rinfo, pq->region,
sbin/unwind/frontend.c
911
reply_info_parsedelete(rinfo, &alloc);
sbin/unwind/frontend.c
912
alloc_clear(&alloc);
sbin/unwind/frontend.c
916
reply_info_parsedelete(rinfo, &alloc);
sbin/unwind/frontend.c
917
alloc_clear(&alloc);
sbin/unwind/frontend.c
926
struct alloc_cache alloc;
sbin/unwind/frontend.c
932
alloc_init(&alloc, NULL, 0);
sbin/unwind/frontend.c
938
if (reply_info_parse(pq->abuf, &alloc, &qinfo, &rinfo, pq->region,
sbin/unwind/libunbound/daemon/worker.h
127
struct alloc_cache *alloc;
sbin/unwind/libunbound/iterator/iter_scrub.c
791
k = alloc_special_obtain(env->alloc);
sbin/unwind/libunbound/iterator/iter_scrub.c
796
alloc_special_release(env->alloc, k);
sbin/unwind/libunbound/iterator/iter_scrub.c
804
(void)rrset_cache_update(env->rrset_cache, &ref, env->alloc, now);
sbin/unwind/libunbound/iterator/iter_utils.c
1172
rrset = packed_rrset_copy_alloc(rrset, env->alloc, *env->now);
sbin/unwind/libunbound/iterator/iter_utils.c
1182
(void)rrset_cache_update(env->rrset_cache, &ref, env->alloc, *env->now);
sbin/unwind/libunbound/libunbound/context.c
111
ctx->env->cfg, ctx->env->alloc);
sbin/unwind/libunbound/libunbound/context.c
224
context_release_alloc(struct ub_ctx* ctx, struct alloc_cache* alloc,
sbin/unwind/libunbound/libunbound/context.c
227
if(!ctx || !alloc)
sbin/unwind/libunbound/libunbound/context.c
232
alloc->super = ctx->alloc_list;
sbin/unwind/libunbound/libunbound/context.c
233
ctx->alloc_list = alloc;
sbin/unwind/libunbound/libunbound/context.h
249
void context_release_alloc(struct ub_ctx* ctx, struct alloc_cache* alloc,
sbin/unwind/libunbound/libunbound/libunbound.c
172
ctx->env->alloc = &ctx->superalloc;
sbin/unwind/libunbound/libunbound/libworker.c
146
w->env->alloc = context_obtain_alloc(ctx, !w->is_bg || w->is_bg_thread);
sbin/unwind/libunbound/libunbound/libworker.c
147
if(!w->env->alloc) {
sbin/unwind/libunbound/libunbound/libworker.c
151
w->thread_num = w->env->alloc->thread_num;
sbin/unwind/libunbound/libunbound/libworker.c
152
alloc_set_id_cleanup(w->env->alloc, &libworker_alloc_cleanup, w);
sbin/unwind/libunbound/libunbound/libworker.c
97
context_release_alloc(w->ctx, w->env->alloc,
sbin/unwind/libunbound/services/cache/dns.c
1130
rep = reply_info_copy(msgrep, env->alloc, NULL);
sbin/unwind/libunbound/services/cache/dns.c
1148
env->alloc,
sbin/unwind/libunbound/services/cache/dns.c
1162
reply_info_parsedelete(rep, env->alloc);
sbin/unwind/libunbound/services/cache/dns.c
203
slabhash_insert(env->msg_cache, hash, &e->entry, rep, env->alloc);
sbin/unwind/libunbound/services/cache/dns.c
90
env->alloc, ((ntohs(rep->ref[i].key->rk.type)==
sbin/unwind/libunbound/services/cache/rrset.c
177
rrset_update_id(struct rrset_ref* ref, struct alloc_cache* alloc)
sbin/unwind/libunbound/services/cache/rrset.c
180
uint64_t newid = alloc_get_id(alloc);
sbin/unwind/libunbound/services/cache/rrset.c
193
struct alloc_cache* alloc, time_t timenow)
sbin/unwind/libunbound/services/cache/rrset.c
219
ub_packed_rrset_parsedelete(k, alloc);
sbin/unwind/libunbound/services/cache/rrset.c
233
slabhash_insert(&r->table, h, &k->entry, k->entry.data, alloc);
sbin/unwind/libunbound/services/cache/rrset.c
241
rrset_update_id(ref, alloc);
sbin/unwind/libunbound/services/cache/rrset.c
250
struct alloc_cache* alloc, time_t timenow)
sbin/unwind/libunbound/services/cache/rrset.c
254
rrset = packed_rrset_copy_alloc(rrset, alloc, timenow);
sbin/unwind/libunbound/services/cache/rrset.c
269
alloc_special_release(alloc, rrset);
sbin/unwind/libunbound/services/cache/rrset.c
278
(void)rrset_cache_update(rrset_cache, &ref, alloc, timenow);
sbin/unwind/libunbound/services/cache/rrset.c
62
struct alloc_cache* alloc)
sbin/unwind/libunbound/services/cache/rrset.c
70
ub_rrset_key_delete, rrset_data_delete, alloc);
sbin/unwind/libunbound/services/cache/rrset.c
86
struct config_file* cfg, struct alloc_cache* alloc)
sbin/unwind/libunbound/services/cache/rrset.c
92
r = rrset_cache_create(cfg, alloc);
sbin/unwind/libunbound/services/cache/rrset.h
134
struct alloc_cache* alloc, time_t timenow);
sbin/unwind/libunbound/services/cache/rrset.h
152
struct alloc_cache* alloc, time_t timenow);
sbin/unwind/libunbound/services/cache/rrset.h
68
struct alloc_cache* alloc);
sbin/unwind/libunbound/services/cache/rrset.h
86
struct config_file* cfg, struct alloc_cache* alloc);
sbin/unwind/libunbound/services/mesh.c
1004
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/mesh.c
1094
alloc_reg_release(mstate->s.env->alloc, mstate->s.region);
sbin/unwind/libunbound/services/mesh.c
967
struct regional* region = alloc_reg_obtain(env->alloc);
sbin/unwind/libunbound/services/mesh.c
975
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/mesh.c
998
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/outside_network.c
1839
alloc_reg_release(sq->alloc, sq->region);
sbin/unwind/libunbound/services/outside_network.c
2631
size_t pad_queries_block_size, struct alloc_cache* alloc,
sbin/unwind/libunbound/services/outside_network.c
2640
alloc_reg_release(alloc, region);
sbin/unwind/libunbound/services/outside_network.c
2644
sq->alloc = alloc;
sbin/unwind/libunbound/services/outside_network.c
2649
alloc_reg_release(alloc, region);
sbin/unwind/libunbound/services/outside_network.c
2656
alloc_reg_release(alloc, region);
sbin/unwind/libunbound/services/outside_network.c
2670
alloc_reg_release(alloc, region);
sbin/unwind/libunbound/services/outside_network.c
2683
alloc_reg_release(alloc, region);
sbin/unwind/libunbound/services/outside_network.c
3444
region = alloc_reg_obtain(env->alloc);
sbin/unwind/libunbound/services/outside_network.c
3450
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/outside_network.c
3458
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/outside_network.c
3493
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/outside_network.c
3509
env->alloc, region);
sbin/unwind/libunbound/services/outside_network.c
3531
alloc_reg_release(env->alloc, region);
sbin/unwind/libunbound/services/outside_network.h
525
struct alloc_cache* alloc;
sbin/unwind/libunbound/util/alloc.c
103
alloc_init(struct alloc_cache* alloc, struct alloc_cache* super,
sbin/unwind/libunbound/util/alloc.c
106
memset(alloc, 0, sizeof(*alloc));
sbin/unwind/libunbound/util/alloc.c
107
alloc->super = super;
sbin/unwind/libunbound/util/alloc.c
108
alloc->thread_num = thread_num;
sbin/unwind/libunbound/util/alloc.c
109
alloc->next_id = (uint64_t)thread_num; /* in steps, so that type */
sbin/unwind/libunbound/util/alloc.c
110
alloc->next_id <<= THRNUM_SHIFT; /* of *_id is used. */
sbin/unwind/libunbound/util/alloc.c
111
alloc->last_id = 1; /* so no 64bit constants, */
sbin/unwind/libunbound/util/alloc.c
112
alloc->last_id <<= THRNUM_SHIFT; /* or implicit 'int' ops. */
sbin/unwind/libunbound/util/alloc.c
113
alloc->last_id -= 1; /* for compiler portability. */
sbin/unwind/libunbound/util/alloc.c
114
alloc->last_id |= alloc->next_id;
sbin/unwind/libunbound/util/alloc.c
115
alloc->next_id += 1; /* because id=0 is special. */
sbin/unwind/libunbound/util/alloc.c
116
alloc->max_reg_blocks = 10;
sbin/unwind/libunbound/util/alloc.c
117
alloc->num_reg_blocks = 0;
sbin/unwind/libunbound/util/alloc.c
118
alloc->reg_list = NULL;
sbin/unwind/libunbound/util/alloc.c
119
alloc->cleanup = NULL;
sbin/unwind/libunbound/util/alloc.c
120
alloc->cleanup_arg = NULL;
sbin/unwind/libunbound/util/alloc.c
121
if(alloc->super)
sbin/unwind/libunbound/util/alloc.c
122
prealloc_blocks(alloc, alloc->max_reg_blocks);
sbin/unwind/libunbound/util/alloc.c
123
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
124
lock_quick_init(&alloc->lock);
sbin/unwind/libunbound/util/alloc.c
125
lock_protect(&alloc->lock, alloc, sizeof(*alloc));
sbin/unwind/libunbound/util/alloc.c
131
alloc_clear_special_list(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
135
p = alloc->quar;
sbin/unwind/libunbound/util/alloc.c
146
alloc_clear_special(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
148
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
149
lock_quick_lock(&alloc->lock);
sbin/unwind/libunbound/util/alloc.c
151
alloc_clear_special_list(alloc);
sbin/unwind/libunbound/util/alloc.c
152
alloc->quar = 0;
sbin/unwind/libunbound/util/alloc.c
153
alloc->num_quar = 0;
sbin/unwind/libunbound/util/alloc.c
154
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
155
lock_quick_unlock(&alloc->lock);
sbin/unwind/libunbound/util/alloc.c
160
alloc_clear(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
164
if(!alloc)
sbin/unwind/libunbound/util/alloc.c
166
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
167
lock_quick_destroy(&alloc->lock);
sbin/unwind/libunbound/util/alloc.c
169
if(alloc->super && alloc->quar) {
sbin/unwind/libunbound/util/alloc.c
171
p = alloc->quar;
sbin/unwind/libunbound/util/alloc.c
174
lock_quick_lock(&alloc->super->lock);
sbin/unwind/libunbound/util/alloc.c
175
alloc_set_special_next(p, alloc->super->quar);
sbin/unwind/libunbound/util/alloc.c
176
alloc->super->quar = alloc->quar;
sbin/unwind/libunbound/util/alloc.c
177
alloc->super->num_quar += alloc->num_quar;
sbin/unwind/libunbound/util/alloc.c
178
lock_quick_unlock(&alloc->super->lock);
sbin/unwind/libunbound/util/alloc.c
180
alloc_clear_special_list(alloc);
sbin/unwind/libunbound/util/alloc.c
182
alloc->quar = 0;
sbin/unwind/libunbound/util/alloc.c
183
alloc->num_quar = 0;
sbin/unwind/libunbound/util/alloc.c
184
r = alloc->reg_list;
sbin/unwind/libunbound/util/alloc.c
190
alloc->reg_list = NULL;
sbin/unwind/libunbound/util/alloc.c
191
alloc->num_reg_blocks = 0;
sbin/unwind/libunbound/util/alloc.c
195
alloc_get_id(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
197
uint64_t id = alloc->next_id++;
sbin/unwind/libunbound/util/alloc.c
198
if(id == alloc->last_id) {
sbin/unwind/libunbound/util/alloc.c
200
fptr_ok(fptr_whitelist_alloc_cleanup(alloc->cleanup));
sbin/unwind/libunbound/util/alloc.c
201
(*alloc->cleanup)(alloc->cleanup_arg);
sbin/unwind/libunbound/util/alloc.c
204
alloc->next_id = (uint64_t)alloc->thread_num;
sbin/unwind/libunbound/util/alloc.c
205
alloc->next_id <<= THRNUM_SHIFT; /* in steps for comp. */
sbin/unwind/libunbound/util/alloc.c
206
alloc->next_id += 1; /* portability. */
sbin/unwind/libunbound/util/alloc.c
208
id = alloc->next_id++;
sbin/unwind/libunbound/util/alloc.c
214
alloc_special_obtain(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
217
log_assert(alloc);
sbin/unwind/libunbound/util/alloc.c
219
if(alloc->quar) {
sbin/unwind/libunbound/util/alloc.c
220
p = alloc->quar;
sbin/unwind/libunbound/util/alloc.c
221
alloc->quar = alloc_special_next(p);
sbin/unwind/libunbound/util/alloc.c
222
alloc->num_quar--;
sbin/unwind/libunbound/util/alloc.c
223
p->id = alloc_get_id(alloc);
sbin/unwind/libunbound/util/alloc.c
227
if(alloc->super) {
sbin/unwind/libunbound/util/alloc.c
230
lock_quick_lock(&alloc->super->lock);
sbin/unwind/libunbound/util/alloc.c
231
if((p = alloc->super->quar)) {
sbin/unwind/libunbound/util/alloc.c
232
alloc->super->quar = alloc_special_next(p);
sbin/unwind/libunbound/util/alloc.c
233
alloc->super->num_quar--;
sbin/unwind/libunbound/util/alloc.c
235
lock_quick_unlock(&alloc->super->lock);
sbin/unwind/libunbound/util/alloc.c
237
p->id = alloc_get_id(alloc);
sbin/unwind/libunbound/util/alloc.c
242
prealloc_setup(alloc);
sbin/unwind/libunbound/util/alloc.c
248
p->id = alloc_get_id(alloc);
sbin/unwind/libunbound/util/alloc.c
254
pushintosuper(struct alloc_cache* alloc, alloc_special_type* mem)
sbin/unwind/libunbound/util/alloc.c
257
alloc_special_type *p = alloc->quar;
sbin/unwind/libunbound/util/alloc.c
259
log_assert(alloc && alloc->super &&
sbin/unwind/libunbound/util/alloc.c
260
alloc->num_quar >= ALLOC_SPECIAL_MAX);
sbin/unwind/libunbound/util/alloc.c
262
alloc_set_special_next(mem, alloc->quar);
sbin/unwind/libunbound/util/alloc.c
266
alloc->quar = alloc_special_next(p);
sbin/unwind/libunbound/util/alloc.c
267
alloc->num_quar -= ALLOC_SPECIAL_MAX/2;
sbin/unwind/libunbound/util/alloc.c
270
lock_quick_lock(&alloc->super->lock);
sbin/unwind/libunbound/util/alloc.c
271
alloc_set_special_next(p, alloc->super->quar);
sbin/unwind/libunbound/util/alloc.c
272
alloc->super->quar = mem;
sbin/unwind/libunbound/util/alloc.c
273
alloc->super->num_quar += ALLOC_SPECIAL_MAX/2 + 1;
sbin/unwind/libunbound/util/alloc.c
274
lock_quick_unlock(&alloc->super->lock);
sbin/unwind/libunbound/util/alloc.c
279
alloc_special_release(struct alloc_cache* alloc, alloc_special_type* mem)
sbin/unwind/libunbound/util/alloc.c
281
log_assert(alloc);
sbin/unwind/libunbound/util/alloc.c
284
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
285
lock_quick_lock(&alloc->lock); /* superalloc needs locking */
sbin/unwind/libunbound/util/alloc.c
289
if(alloc->super && alloc->num_quar >= ALLOC_SPECIAL_MAX) {
sbin/unwind/libunbound/util/alloc.c
291
pushintosuper(alloc, mem);
sbin/unwind/libunbound/util/alloc.c
295
alloc_set_special_next(mem, alloc->quar);
sbin/unwind/libunbound/util/alloc.c
296
alloc->quar = mem;
sbin/unwind/libunbound/util/alloc.c
297
alloc->num_quar++;
sbin/unwind/libunbound/util/alloc.c
298
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
299
lock_quick_unlock(&alloc->lock);
sbin/unwind/libunbound/util/alloc.c
304
alloc_stats(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
306
log_info("%salloc: %d in cache, %d blocks.", alloc->super?"":"sup",
sbin/unwind/libunbound/util/alloc.c
307
(int)alloc->num_quar, (int)alloc->num_reg_blocks);
sbin/unwind/libunbound/util/alloc.c
310
size_t alloc_get_mem(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
313
size_t s = sizeof(*alloc);
sbin/unwind/libunbound/util/alloc.c
314
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
315
lock_quick_lock(&alloc->lock); /* superalloc needs locking */
sbin/unwind/libunbound/util/alloc.c
317
s += sizeof(alloc_special_type) * alloc->num_quar;
sbin/unwind/libunbound/util/alloc.c
318
for(p = alloc->quar; p; p = alloc_special_next(p)) {
sbin/unwind/libunbound/util/alloc.c
321
s += alloc->num_reg_blocks * ALLOC_REG_SIZE;
sbin/unwind/libunbound/util/alloc.c
322
if(!alloc->super) {
sbin/unwind/libunbound/util/alloc.c
323
lock_quick_unlock(&alloc->lock);
sbin/unwind/libunbound/util/alloc.c
329
alloc_reg_obtain(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
331
if(alloc->num_reg_blocks > 0) {
sbin/unwind/libunbound/util/alloc.c
332
struct regional* r = alloc->reg_list;
sbin/unwind/libunbound/util/alloc.c
333
alloc->reg_list = (struct regional*)r->next;
sbin/unwind/libunbound/util/alloc.c
335
alloc->num_reg_blocks--;
sbin/unwind/libunbound/util/alloc.c
342
alloc_reg_release(struct alloc_cache* alloc, struct regional* r)
sbin/unwind/libunbound/util/alloc.c
344
if(alloc->num_reg_blocks >= alloc->max_reg_blocks) {
sbin/unwind/libunbound/util/alloc.c
351
r->next = (char*)alloc->reg_list;
sbin/unwind/libunbound/util/alloc.c
352
alloc->reg_list = r;
sbin/unwind/libunbound/util/alloc.c
353
alloc->num_reg_blocks++;
sbin/unwind/libunbound/util/alloc.c
357
alloc_set_id_cleanup(struct alloc_cache* alloc, void (*cleanup)(void*),
sbin/unwind/libunbound/util/alloc.c
360
alloc->cleanup = cleanup;
sbin/unwind/libunbound/util/alloc.c
361
alloc->cleanup_arg = arg;
sbin/unwind/libunbound/util/alloc.c
67
prealloc_setup(struct alloc_cache* alloc)
sbin/unwind/libunbound/util/alloc.c
78
alloc_set_special_next(p, alloc->quar);
sbin/unwind/libunbound/util/alloc.c
79
alloc->quar = p;
sbin/unwind/libunbound/util/alloc.c
80
alloc->num_quar++;
sbin/unwind/libunbound/util/alloc.c
86
prealloc_blocks(struct alloc_cache* alloc, size_t num)
sbin/unwind/libunbound/util/alloc.c
96
r->next = (char*)alloc->reg_list;
sbin/unwind/libunbound/util/alloc.c
97
alloc->reg_list = r;
sbin/unwind/libunbound/util/alloc.c
98
alloc->num_reg_blocks ++;
sbin/unwind/libunbound/util/alloc.h
107
void alloc_init(struct alloc_cache* alloc, struct alloc_cache* super,
sbin/unwind/libunbound/util/alloc.h
116
void alloc_clear(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
124
void alloc_clear_special(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
132
alloc_special_type* alloc_special_obtain(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
140
void alloc_special_release(struct alloc_cache* alloc, alloc_special_type* mem);
sbin/unwind/libunbound/util/alloc.h
148
uint64_t alloc_get_id(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
155
size_t alloc_get_mem(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
161
void alloc_stats(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
168
struct regional* alloc_reg_obtain(struct alloc_cache* alloc);
sbin/unwind/libunbound/util/alloc.h
175
void alloc_reg_release(struct alloc_cache* alloc, struct regional* r);
sbin/unwind/libunbound/util/alloc.h
184
void alloc_set_id_cleanup(struct alloc_cache* alloc, void (*cleanup)(void*),
sbin/unwind/libunbound/util/data/msgreply.c
155
reply_info_alloc_rrset_keys(struct reply_info* rep, struct alloc_cache* alloc,
sbin/unwind/libunbound/util/data/msgreply.c
170
else rep->rrsets[i] = alloc_special_obtain(alloc);
sbin/unwind/libunbound/util/data/msgreply.c
527
struct alloc_cache* alloc, struct query_info* qinf,
sbin/unwind/libunbound/util/data/msgreply.c
535
if(!reply_info_alloc_rrset_keys(*rep, alloc, region)) {
sbin/unwind/libunbound/util/data/msgreply.c
536
if(!region) reply_info_parsedelete(*rep, alloc);
sbin/unwind/libunbound/util/data/msgreply.c
540
if(!region) reply_info_parsedelete(*rep, alloc);
sbin/unwind/libunbound/util/data/msgreply.c
546
int reply_info_parse(sldns_buffer* pkt, struct alloc_cache* alloc,
sbin/unwind/libunbound/util/data/msgreply.c
571
if(!parse_create_msg(pkt, msg, alloc, qinf, rep, NULL)) {
sbin/unwind/libunbound/util/data/msgreply.c
621
reply_info_parsedelete(struct reply_info* rep, struct alloc_cache* alloc)
sbin/unwind/libunbound/util/data/msgreply.c
628
ub_packed_rrset_parsedelete(rep->rrsets[i], alloc);
sbin/unwind/libunbound/util/data/msgreply.c
796
reply_info_copy(struct reply_info* rep, struct alloc_cache* alloc,
sbin/unwind/libunbound/util/data/msgreply.c
819
reply_info_parsedelete(cp, alloc);
sbin/unwind/libunbound/util/data/msgreply.c
827
if(!reply_info_alloc_rrset_keys(cp, alloc, region)) {
sbin/unwind/libunbound/util/data/msgreply.c
829
reply_info_parsedelete(cp, alloc);
sbin/unwind/libunbound/util/data/msgreply.c
834
reply_info_parsedelete(cp, alloc);
sbin/unwind/libunbound/util/data/msgreply.h
302
int reply_info_parse(struct sldns_buffer* pkt, struct alloc_cache* alloc,
sbin/unwind/libunbound/util/data/msgreply.h
322
struct alloc_cache* alloc, struct query_info* qinf,
sbin/unwind/libunbound/util/data/msgreply.h
349
void reply_info_parsedelete(struct reply_info* rep, struct alloc_cache* alloc);
sbin/unwind/libunbound/util/data/msgreply.h
398
struct alloc_cache* alloc, struct regional* region);
sbin/unwind/libunbound/util/data/msgreply.h
413
struct alloc_cache* alloc, struct regional* region);
sbin/unwind/libunbound/util/data/packed_rrset.c
376
struct alloc_cache* alloc, time_t now)
sbin/unwind/libunbound/util/data/packed_rrset.c
379
struct ub_packed_rrset_key* dk = alloc_special_obtain(alloc);
sbin/unwind/libunbound/util/data/packed_rrset.c
386
alloc_special_release(alloc, dk);
sbin/unwind/libunbound/util/data/packed_rrset.c
392
alloc_special_release(alloc, dk);
sbin/unwind/libunbound/util/data/packed_rrset.c
57
struct alloc_cache* alloc)
sbin/unwind/libunbound/util/data/packed_rrset.c
66
alloc_special_release(alloc, pkey);
sbin/unwind/libunbound/util/data/packed_rrset.h
304
struct alloc_cache* alloc);
sbin/unwind/libunbound/util/data/packed_rrset.h
460
struct ub_packed_rrset_key* key, struct alloc_cache* alloc,
sbin/unwind/libunbound/util/module.h
495
struct alloc_cache* alloc;
sbin/unwind/libunbound/validator/validator.c
1038
env->alloc, *env->now);
sbin/unwind/resolver.c
2341
struct alloc_cache alloc;
sbin/unwind/resolver.c
2352
alloc_init(&alloc, NULL, 0);
sbin/unwind/resolver.c
2385
if (reply_info_parse(buf, &alloc, &qinfo, &rinfo, region, &edns) != 0)
sbin/unwind/resolver.c
2448
reply_info_parsedelete(rinfo, &alloc);
sbin/unwind/resolver.c
2449
alloc_clear(&alloc);
sys/arch/alpha/include/loadfile_machdep.h
47
#define ALLOC(a) alloc(a)
sys/arch/alpha/stand/boot/disk.c
118
sc = alloc(sizeof(struct disk_softc));
sys/arch/alpha/stand/nboot/disk.c
113
sc = alloc(sizeof(struct disk_softc));
sys/arch/amd64/include/loadfile_machdep.h
58
#define ALLOC(a) alloc(a)
sys/arch/amd64/stand/efiboot/diskprobe.c
166
bios_diskinfo = alloc(++i * sizeof(bios_diskinfo_t));
sys/arch/amd64/stand/efiboot/efiboot.c
121
if ((run_i386 = alloc(run_i386_size)) == NULL)
sys/arch/amd64/stand/efiboot/efiboot.c
194
handles = alloc(sz);
sys/arch/amd64/stand/efiboot/efiboot.c
222
di = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/efiboot/efiboot.c
349
mm = alloc(siz);
sys/arch/amd64/stand/efiboot/efiboot.c
688
handles = alloc(sz);
sys/arch/amd64/stand/efiboot/efidev.c
579
dip = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/efiboot/efidev.c
77
dip->efi_info = alloc(sizeof(struct efi_diskinfo));
sys/arch/amd64/stand/efiboot/efidev.c
811
fname = alloc(pathlen * sizeof(*fname));
sys/arch/amd64/stand/efiboot/efidev.c
922
fip = alloc(filen);
sys/arch/amd64/stand/efiboot/efipxe.c
135
tftpfile = alloc(sizeof(*tftpfile));
sys/arch/amd64/stand/efiboot/efipxe.c
99
bootdev_dip = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/efiboot/efirng.c
74
random = alloc(buflen);
sys/arch/amd64/stand/efiboot/exec_i386.c
86
if ((av = alloc(ac)) == NULL)
sys/arch/amd64/stand/libsa/biosdev.c
273
bb = bb1 = alloc(bbsize * 2);
sys/arch/amd64/stand/libsa/biosdev.c
554
dip = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/libsa/diskprobe.c
127
dip = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/libsa/diskprobe.c
215
bios_diskinfo = alloc(++i * sizeof(bios_diskinfo_t));
sys/arch/amd64/stand/libsa/diskprobe.c
240
dip = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/libsa/diskprobe.c
85
dip = alloc(sizeof(struct diskinfo));
sys/arch/amd64/stand/libsa/softraid_amd64.c
117
kd = alloc(sizeof(struct sr_boot_keydisk));
sys/arch/amd64/stand/libsa/softraid_amd64.c
142
md = alloc(SR_META_SIZE * DEV_BSIZE);
sys/arch/amd64/stand/libsa/softraid_amd64.c
185
bc = alloc(sizeof(struct sr_boot_chunk));
sys/arch/amd64/stand/libsa/softraid_amd64.c
206
bv = alloc(sizeof(struct sr_boot_volume));
sys/arch/amd64/stand/libsa/softraid_amd64.c
459
buf = alloc(bv->sbv_secsize);
sys/arch/amd64/stand/libsa/softraid_amd64.c
66
omi = alloc(sizeof(struct sr_meta_opt_item));
sys/arch/amd64/stand/libsa/softraid_amd64.c
69
omi->omi_som = alloc(omh->som_length);
sys/arch/arm64/include/loadfile_machdep.h
50
#define ALLOC(a) alloc(a)
sys/arch/arm64/stand/efiboot/efiboot.c
1046
mm = alloc(siz);
sys/arch/arm64/stand/efiboot/efiboot.c
294
handles = alloc(sz);
sys/arch/arm64/stand/efiboot/efiboot.c
322
di = alloc(sizeof(struct diskinfo));
sys/arch/arm64/stand/efiboot/efidev.c
603
fname = alloc(pathlen * sizeof(*fname));
sys/arch/arm64/stand/efiboot/efidev.c
714
fip = alloc(filen);
sys/arch/arm64/stand/efiboot/efipxe.c
161
tftpfile = alloc(sizeof(*tftpfile));
sys/arch/arm64/stand/efiboot/efipxe.c
451
buf = alloc(bufsz + ETHER_ALIGN);
sys/arch/arm64/stand/efiboot/efirng.c
74
random = alloc(buflen);
sys/arch/arm64/stand/efiboot/smbios.c
330
hw_vendor = alloc(infolen);
sys/arch/arm64/stand/efiboot/smbios.c
347
hw_prod = alloc(infolen);
sys/arch/arm64/stand/efiboot/smbios.c
359
hw_ver = alloc(infolen);
sys/arch/arm64/stand/efiboot/smbios.c
369
hw_serial = alloc(infolen);
sys/arch/arm64/stand/efiboot/softraid_arm64.c
120
kd = alloc(sizeof(struct sr_boot_keydisk));
sys/arch/arm64/stand/efiboot/softraid_arm64.c
144
md = alloc(SR_META_SIZE * DEV_BSIZE);
sys/arch/arm64/stand/efiboot/softraid_arm64.c
182
bc = alloc(sizeof(struct sr_boot_chunk));
sys/arch/arm64/stand/efiboot/softraid_arm64.c
200
bv = alloc(sizeof(struct sr_boot_volume));
sys/arch/arm64/stand/efiboot/softraid_arm64.c
451
buf = alloc(bv->sbv_secsize);
sys/arch/arm64/stand/efiboot/softraid_arm64.c
615
dip = alloc(sizeof(struct diskinfo));
sys/arch/arm64/stand/efiboot/softraid_arm64.c
69
omi = alloc(sizeof(struct sr_meta_opt_item));
sys/arch/arm64/stand/efiboot/softraid_arm64.c
72
omi->omi_som = alloc(omh->som_length);
sys/arch/armv7/include/loadfile_machdep.h
50
#define ALLOC(a) alloc(a)
sys/arch/armv7/stand/efiboot/efiboot.c
277
handles = alloc(sz);
sys/arch/armv7/stand/efiboot/efiboot.c
305
di = alloc(sizeof(struct diskinfo));
sys/arch/armv7/stand/efiboot/efiboot.c
919
mm = alloc(siz);
sys/arch/armv7/stand/efiboot/efipxe.c
161
tftpfile = alloc(sizeof(*tftpfile));
sys/arch/armv7/stand/efiboot/efipxe.c
451
buf = alloc(bufsz + ETHER_ALIGN);
sys/arch/hppa/include/loadfile_machdep.h
56
#define ALLOC(a) alloc(a)
sys/arch/hppa/stand/libsa/dev_hppa.c
92
if (!(hpd = alloc(sizeof *hpd))) {
sys/arch/hppa/stand/libsa/lif.c
66
fp = alloc(sizeof(*fp));
sys/arch/i386/include/loadfile_machdep.h
52
#define ALLOC(a) alloc(a)
sys/arch/i386/stand/libsa/biosdev.c
274
bb = bb1 = alloc(bbsize * 2);
sys/arch/i386/stand/libsa/biosdev.c
553
dip = alloc(sizeof(struct diskinfo));
sys/arch/i386/stand/libsa/diskprobe.c
131
dip = alloc(sizeof(struct diskinfo));
sys/arch/i386/stand/libsa/diskprobe.c
281
bios_diskinfo = alloc(++i * sizeof(bios_diskinfo_t));
sys/arch/i386/stand/libsa/diskprobe.c
307
dip = alloc(sizeof(struct diskinfo));
sys/arch/i386/stand/libsa/diskprobe.c
89
dip = alloc(sizeof(struct diskinfo));
sys/arch/i386/stand/libsa/exec_i386.c
84
if ((av = alloc(ac)) == NULL)
sys/arch/i386/stand/libsa/softraid_i386.c
113
kd = alloc(sizeof(struct sr_boot_keydisk));
sys/arch/i386/stand/libsa/softraid_i386.c
138
md = alloc(SR_META_SIZE * DEV_BSIZE);
sys/arch/i386/stand/libsa/softraid_i386.c
181
bc = alloc(sizeof(struct sr_boot_chunk));
sys/arch/i386/stand/libsa/softraid_i386.c
202
bv = alloc(sizeof(struct sr_boot_volume));
sys/arch/i386/stand/libsa/softraid_i386.c
62
omi = alloc(sizeof(struct sr_meta_opt_item));
sys/arch/i386/stand/libsa/softraid_i386.c
65
omi->omi_som = alloc(omh->som_length);
sys/arch/landisk/include/loadfile_machdep.h
48
#define ALLOC(a) alloc(a)
sys/arch/landisk/stand/xxboot/ufs12.c
129
buf = alloc(fs->fs_bsize);
sys/arch/landisk/stand/xxboot/ufs12.c
184
buf = alloc(fs->fs_bsize);
sys/arch/landisk/stand/xxboot/ufs12.c
293
alloc(fs->fs_bsize);
sys/arch/landisk/stand/xxboot/ufs12.c
348
fp->f_buf = alloc(fs->fs_bsize);
sys/arch/landisk/stand/xxboot/ufs12.c
452
fp = alloc(sizeof(struct file));
sys/arch/landisk/stand/xxboot/ufs12.c
457
fs = alloc(SBSIZE);
sys/arch/landisk/stand/xxboot/ufs12.c
603
buf = alloc(fs->fs_bsize);
sys/arch/loongson/include/loadfile_machdep.h
48
#define ALLOC(a) alloc(a)
sys/arch/loongson/stand/boot/dev.c
113
pi = alloc(sizeof *pi);
sys/arch/loongson/stand/boot/exec.c
45
newargv = alloc(newargc * sizeof(int32_t));
sys/arch/luna88k/include/loadfile_machdep.h
46
#define ALLOC(a) alloc(a)
sys/arch/luna88k/stand/boot/sd.c
212
sc = alloc(sizeof *sc);
sys/arch/macppc/include/loadfile_machdep.h
48
#define ALLOC(a) alloc(a)
sys/arch/macppc/stand/ofdev.c
322
if ((ofdev = alloc(sizeof *ofdev)) == NULL)
sys/arch/octeon/include/loadfile_machdep.h
48
#define ALLOC(a) alloc(a)
sys/arch/riscv64/include/loadfile_machdep.h
50
#define ALLOC(a) alloc(a)
sys/arch/riscv64/stand/efiboot/efiboot.c
255
handles = alloc(sz);
sys/arch/riscv64/stand/efiboot/efiboot.c
283
di = alloc(sizeof(struct diskinfo));
sys/arch/riscv64/stand/efiboot/efiboot.c
924
mm = alloc(siz);
sys/arch/riscv64/stand/efiboot/efipxe.c
161
tftpfile = alloc(sizeof(*tftpfile));
sys/arch/riscv64/stand/efiboot/efipxe.c
451
buf = alloc(bufsz + ETHER_ALIGN);
sys/arch/riscv64/stand/efiboot/efirng.c
74
random = alloc(buflen);
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
120
kd = alloc(sizeof(struct sr_boot_keydisk));
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
144
md = alloc(SR_META_SIZE * DEV_BSIZE);
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
182
bc = alloc(sizeof(struct sr_boot_chunk));
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
200
bv = alloc(sizeof(struct sr_boot_volume));
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
451
buf = alloc(bv->sbv_secsize);
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
615
dip = alloc(sizeof(struct diskinfo));
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
69
omi = alloc(sizeof(struct sr_meta_opt_item));
sys/arch/riscv64/stand/efiboot/softraid_riscv64.c
72
omi->omi_som = alloc(omh->som_length);
sys/arch/sparc64/include/loadfile_machdep.h
53
#define ALLOC(a) alloc(a)
sys/arch/sparc64/stand/ofwboot/boot.c
399
dip = alloc(sizeof(struct diskinfo));
sys/arch/sparc64/stand/ofwboot/diskprobe.c
47
dip = alloc(sizeof(*dip));
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
193
shp = addr = alloc(elf->e_shnum * sizeof(Elf_Shdr));
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
202
char *shstr = alloc(shstrsz);
sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c
115
kd = alloc(sizeof(struct sr_boot_keydisk));
sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c
141
md = alloc(SR_META_SIZE * DEV_BSIZE);
sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c
182
bc = alloc(sizeof(struct sr_boot_chunk));
sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c
205
bv = alloc(sizeof(struct sr_boot_volume));
sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c
64
omi = alloc(sizeof(struct sr_meta_opt_item));
sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c
67
omi->omi_som = alloc(omh->som_length);
sys/dev/isa/isapnp.c
276
struct isa_attach_args *ipa, int alloc)
sys/dev/isa/isapnp.c
315
if (alloc)
sys/dev/pci/drm/amd/amdgpu/amdgpu_atombios.c
1214
struct _SET_VOLTAGE_PS_ALLOCATION alloc;
sys/dev/pci/drm/amd/amdgpu/amdgpu_ctx.c
691
args->out.alloc.ctx_id = id;
sys/dev/pci/drm/amd/amdgpu/amdgpu_gtt_mgr.c
260
.alloc = amdgpu_gtt_mgr_new,
sys/dev/pci/drm/amd/amdgpu/amdgpu_preempt_mgr.c
89
.alloc = amdgpu_preempt_mgr_new,
sys/dev/pci/drm/amd/amdgpu/amdgpu_vram_mgr.c
917
.alloc = amdgpu_vram_mgr_new,
sys/dev/pci/drm/drm_atomic.c
1150
int alloc = max(index + 1, config->num_connector);
sys/dev/pci/drm/drm_atomic.c
1153
c = krealloc_array(state->connectors, alloc,
sys/dev/pci/drm/drm_atomic.c
1158
c = kmalloc_array(alloc,
sys/dev/pci/drm/drm_atomic.c
1169
sizeof(*state->connectors) * (alloc - state->num_connector));
sys/dev/pci/drm/drm_atomic.c
1171
state->num_connector = alloc;
sys/dev/pci/drm/i915/display/skl_watermark.c
1418
const struct skl_ddb_entry *alloc = &dbuf_state->ddb[crtc->pipe];
sys/dev/pci/drm/i915/display/skl_watermark.c
1438
iter.start = alloc->start;
sys/dev/pci/drm/i915/display/skl_watermark.c
1439
iter.size = skl_ddb_entry_size(alloc);
sys/dev/pci/drm/i915/display/skl_watermark.c
1447
alloc->end - cursor_size, alloc->end);
sys/dev/pci/drm/i915/gt/intel_context.c
76
err = ce->ops->alloc(ce);
sys/dev/pci/drm/i915/gt/intel_context_types.h
41
int (*alloc)(struct intel_context *ce);
sys/dev/pci/drm/i915/gt/intel_execlists_submission.c
2695
.alloc = execlists_context_alloc,
sys/dev/pci/drm/i915/gt/intel_execlists_submission.c
3775
.alloc = virtual_context_alloc,
sys/dev/pci/drm/i915/gt/intel_ring_submission.c
679
.alloc = ring_context_alloc,
sys/dev/pci/drm/i915/gt/mock_engine.c
203
.alloc = mock_context_alloc,
sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
3782
.alloc = guc_context_alloc,
sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
4058
.alloc = guc_virtual_context_alloc,
sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
4150
.alloc = guc_virtual_context_alloc,
sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
4174
.alloc = guc_virtual_context_alloc,
sys/dev/pci/drm/i915/i915_query.c
379
int alloc, n_configs;
sys/dev/pci/drm/i915/i915_query.c
418
alloc = fetch_and_zero(&n_configs);
sys/dev/pci/drm/i915/i915_query.c
423
if (n_configs < alloc)
sys/dev/pci/drm/i915/i915_query.c
430
} while (n_configs > alloc);
sys/dev/pci/drm/i915/i915_ttm_buddy_manager.c
248
.alloc = i915_ttm_buddy_man_alloc,
sys/dev/pci/drm/i915/intel_region_ttm.c
244
ret = man->func->alloc(man, &mock_bo, &place, &res);
sys/dev/pci/drm/include/drm/ttm/ttm_resource.h
112
int (*alloc)(struct ttm_resource_manager *man,
sys/dev/pci/drm/include/uapi/drm/amdgpu_drm.h
312
} alloc;
sys/dev/pci/drm/radeon/radeon_atombios.c
3107
struct _SET_VOLTAGE_PS_ALLOCATION alloc;
sys/dev/pci/drm/ttm/tests/ttm_mock_manager.c
181
.alloc = ttm_bad_manager_alloc,
sys/dev/pci/drm/ttm/tests/ttm_mock_manager.c
187
.alloc = ttm_busy_manager_alloc,
sys/dev/pci/drm/ttm/tests/ttm_mock_manager.c
92
.alloc = ttm_mock_manager_alloc,
sys/dev/pci/drm/ttm/tests/ttm_resource_test.c
279
ret = man->func->alloc(man, bo, place, &res);
sys/dev/pci/drm/ttm/ttm_pool.c
1006
ttm_pool_alloc_state_init(tt, &alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
1014
tt->restore->snapshot_alloc = alloc;
sys/dev/pci/drm/ttm/ttm_pool.c
1021
alloc = restore->snapshot_alloc;
sys/dev/pci/drm/ttm/ttm_pool.c
1023
ret = ttm_pool_restore_commit(restore, tt->backup, ctx, &alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
1027
if (!alloc.remaining_pages)
sys/dev/pci/drm/ttm/ttm_pool.c
1031
return __ttm_pool_alloc(pool, tt, ctx, &alloc, tt->restore);
sys/dev/pci/drm/ttm/ttm_pool.c
309
static int ttm_pool_apply_caching(struct ttm_pool_alloc_state *alloc)
sys/dev/pci/drm/ttm/ttm_pool.c
312
unsigned int num_pages = alloc->pages - alloc->caching_divide;
sys/dev/pci/drm/ttm/ttm_pool.c
317
switch (alloc->tt_caching) {
sys/dev/pci/drm/ttm/ttm_pool.c
321
return set_pages_array_wc(alloc->caching_divide, num_pages);
sys/dev/pci/drm/ttm/ttm_pool.c
323
return set_pages_array_uc(alloc->caching_divide, num_pages);
sys/dev/pci/drm/ttm/ttm_pool.c
326
alloc->caching_divide = alloc->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
634
struct ttm_pool_alloc_state *alloc,
sys/dev/pci/drm/ttm/ttm_pool.c
641
*alloc->pages++ = allocated++;
sys/dev/pci/drm/ttm/ttm_pool.c
642
*alloc->orders++ = order;
sys/dev/pci/drm/ttm/ttm_pool.c
645
alloc->remaining_pages -= nr;
sys/dev/pci/drm/ttm/ttm_pool.c
647
if (!alloc->dma_addr)
sys/dev/pci/drm/ttm/ttm_pool.c
651
*alloc->dma_addr++ = first_dma;
sys/dev/pci/drm/ttm/ttm_pool.c
663
struct ttm_pool_alloc_state *alloc)
sys/dev/pci/drm/ttm/ttm_pool.c
670
struct vm_page **first_page = alloc->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
715
dma_addr_t *dma_addr = alloc->dma_addr ? &restore->first_dma : NULL;
sys/dev/pci/drm/ttm/ttm_pool.c
725
alloc, nr);
sys/dev/pci/drm/ttm/ttm_pool.c
726
if (restore->page_caching == alloc->tt_caching || PageHighMem(restore->alloced_page))
sys/dev/pci/drm/ttm/ttm_pool.c
727
alloc->caching_divide = alloc->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
728
restore->snapshot_alloc = *alloc;
sys/dev/pci/drm/ttm/ttm_pool.c
742
const struct ttm_pool_alloc_state *alloc)
sys/dev/pci/drm/ttm/ttm_pool.c
750
restore->snapshot_alloc = *alloc;
sys/dev/pci/drm/ttm/ttm_pool.c
762
struct ttm_pool_alloc_state *alloc,
sys/dev/pci/drm/ttm/ttm_pool.c
769
caching_consistent = (page_caching == alloc->tt_caching) || PageHighMem(p);
sys/dev/pci/drm/ttm/ttm_pool.c
772
r = ttm_pool_apply_caching(alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
777
if (alloc->dma_addr) {
sys/dev/pci/drm/ttm/ttm_pool.c
785
first_dma, restore, alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
787
ttm_pool_allocated_page_commit(p, first_dma, alloc, 1UL << order);
sys/dev/pci/drm/ttm/ttm_pool.c
790
alloc->caching_divide = alloc->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
836
struct ttm_pool_alloc_state *alloc)
sys/dev/pci/drm/ttm/ttm_pool.c
838
alloc->pages = tt->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
839
alloc->caching_divide = tt->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
840
alloc->dma_addr = tt->dma_address;
sys/dev/pci/drm/ttm/ttm_pool.c
841
alloc->remaining_pages = tt->num_pages;
sys/dev/pci/drm/ttm/ttm_pool.c
842
alloc->tt_caching = tt->caching;
sys/dev/pci/drm/ttm/ttm_pool.c
843
alloc->orders = tt->orders;
sys/dev/pci/drm/ttm/ttm_pool.c
851
const struct ttm_pool_alloc_state *alloc)
sys/dev/pci/drm/ttm/ttm_pool.c
853
return min_t(unsigned int, highest, __fls(alloc->remaining_pages));
sys/dev/pci/drm/ttm/ttm_pool.c
858
struct ttm_pool_alloc_state *alloc,
sys/dev/pci/drm/ttm/ttm_pool.c
870
WARN_ON(!alloc->remaining_pages || ttm_tt_is_populated(tt));
sys/dev/pci/drm/ttm/ttm_pool.c
872
WARN_ON(alloc->dma_addr && !pool->dev);
sys/dev/pci/drm/ttm/ttm_pool.c
888
for (order = ttm_pool_alloc_find_order(MAX_PAGE_ORDER, alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
889
alloc->remaining_pages;
sys/dev/pci/drm/ttm/ttm_pool.c
890
order = ttm_pool_alloc_find_order(order, alloc)) {
sys/dev/pci/drm/ttm/ttm_pool.c
920
r = ttm_pool_page_allocated(pool, order, p, page_caching, alloc,
sys/dev/pci/drm/ttm/ttm_pool.c
926
r = ttm_pool_restore_commit(restore, tt->backup, ctx, alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
932
r = ttm_pool_apply_caching(alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
948
caching_divide = alloc->caching_divide - tt->pages;
sys/dev/pci/drm/ttm/ttm_pool.c
951
tt->num_pages - alloc->remaining_pages);
sys/dev/pci/drm/ttm/ttm_pool.c
971
struct ttm_pool_alloc_state alloc;
sys/dev/pci/drm/ttm/ttm_pool.c
976
ttm_pool_alloc_state_init(tt, &alloc);
sys/dev/pci/drm/ttm/ttm_pool.c
978
return __ttm_pool_alloc(pool, tt, ctx, &alloc, NULL);
sys/dev/pci/drm/ttm/ttm_pool.c
998
struct ttm_pool_alloc_state alloc;
sys/dev/pci/drm/ttm/ttm_range_manager.c
160
.alloc = ttm_range_man_alloc,
sys/dev/pci/drm/ttm/ttm_resource.c
391
ret = man->func->alloc(man, bo, place, res_ptr);
sys/dev/pci/drm/ttm/ttm_sys_manager.c
31
.alloc = ttm_sys_man_alloc,
sys/dev/pci/if_iwx.c
3450
cmd.alloc.sta_id_mask = htole32(1 << IWX_STATION_ID);
sys/dev/pci/if_iwx.c
3451
cmd.alloc.tid = tid;
sys/dev/pci/if_iwx.c
3452
cmd.alloc.ssn = htole16(ssn);
sys/dev/pci/if_iwx.c
3453
cmd.alloc.win_size = htole16(winsize);
sys/dev/pci/if_iwxreg.h
6240
struct iwx_rx_baid_cfg_cmd_alloc alloc;
sys/dev/pv/xen.c
1073
alloc:
sys/dev/pv/xen.c
1082
goto alloc;
sys/kern/kern_malloc.c
374
long alloc;
sys/kern/kern_malloc.c
421
alloc = addrmask[BUCKETINDX(PAGE_SIZE)];
sys/kern/kern_malloc.c
423
alloc = addrmask[kup->ku_indx];
sys/kern/kern_malloc.c
424
if (((u_long)addr & alloc) != 0)
sys/kern/kern_malloc.c
426
addr, size, memname[type], alloc);
sys/kern/subr_extent.c
1161
goto alloc;
sys/kern/subr_extent.c
1184
alloc:
sys/lib/libsa/cd9660.c
136
buf = alloc(buf_size = ISO_DEFAULT_BLOCK_SIZE);
sys/lib/libsa/cd9660.c
166
buf = alloc(buf_size = roundup(psize, ISO_DEFAULT_BLOCK_SIZE));
sys/lib/libsa/cd9660.c
253
fp = alloc(sizeof(struct file));
sys/lib/libsa/cread.c
204
ss[fd] = s = alloc(sizeof(struct sd));
sys/lib/libsa/cread.c
212
s->stream.next_in = s->inbuf = (unsigned char *)alloc(Z_BUFSIZE);
sys/lib/libsa/cread.c
86
return(alloc(items * size));
sys/lib/libsa/nfs.c
402
newfd = alloc(sizeof(*newfd));
sys/lib/libsa/pkcs5_pbkdf2.c
44
if ((asalt = alloc(salt_len + 4)) == NULL)
sys/lib/libsa/softraid.c
253
keys = alloc(SR_CRYPTO_KEYBLOCK_BYTES);
sys/lib/libsa/softraid.c
287
bv->sbv_maskkey = alloc(sizeof(kdfinfo.maskkey));
sys/lib/libsa/stand.h
129
void *alloc(u_int);
sys/lib/libsa/tftp.c
263
tftpfile = (struct tftp_handle *) alloc(sizeof(*tftpfile));
sys/lib/libsa/ufs.c
123
buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs.c
173
buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs.c
272
alloc(fs->fs_bsize);
sys/lib/libsa/ufs.c
323
fp->f_buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs.c
417
fp = alloc(sizeof(struct file));
sys/lib/libsa/ufs.c
422
fs = alloc(SBSIZE);
sys/lib/libsa/ufs.c
538
buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs2.c
122
buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs2.c
171
buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs2.c
268
alloc(fs->fs_bsize);
sys/lib/libsa/ufs2.c
319
fp->f_buf = alloc(fs->fs_bsize);
sys/lib/libsa/ufs2.c
413
fp = alloc(sizeof(struct file));
sys/lib/libsa/ufs2.c
418
fs = alloc(SBSIZE);
sys/lib/libsa/ufs2.c
534
buf = alloc(fs->fs_bsize);
sys/netinet/ip_ah.c
208
int ad, alloc, nxt, noff;
sys/netinet/ip_ah.c
384
alloc = 1;
sys/netinet/ip_ah.c
389
alloc = 0;
sys/netinet/ip_ah.c
477
if (alloc)
sys/netinet/ip_ah.c
490
if (alloc)
sys/netinet/ip_ah.c
503
if (alloc) {
sys/stand/boot/bootarg.c
38
bootarg_t *q = alloc(sizeof(*q) + l - sizeof(q->ba_arg));
sys/stand/boot/vars.c
278
p = environ = alloc(4096);
sys/sys/malloc.h
377
#define kmemxtob(alloc) (kmembase + (alloc) * PAGE_SIZE)
usr.bin/mandoc/mandoc_ohash.c
35
info.alloc = hash_alloc;
usr.bin/ssh/sshbuf.c
102
if ((ret->cd = ret->d = calloc(1, ret->alloc)) == NULL) {
usr.bin/ssh/sshbuf.c
117
ret->alloc = ret->size = ret->max_size = len;
usr.bin/ssh/sshbuf.c
189
freezero(buf->d, buf->alloc);
usr.bin/ssh/sshbuf.c
206
if (buf->alloc != SSHBUF_SIZE_INIT) {
usr.bin/ssh/sshbuf.c
207
if ((d = recallocarray(buf->d, buf->alloc, SSHBUF_SIZE_INIT,
usr.bin/ssh/sshbuf.c
210
buf->alloc = SSHBUF_SIZE_INIT;
usr.bin/ssh/sshbuf.c
213
explicit_bzero(buf->d, buf->alloc);
usr.bin/ssh/sshbuf.c
225
return buf->alloc;
usr.bin/ssh/sshbuf.c
258
if (max_size < buf->alloc && max_size > buf->size) {
usr.bin/ssh/sshbuf.c
266
if ((dp = recallocarray(buf->d, buf->alloc, rlen, 1)) == NULL)
usr.bin/ssh/sshbuf.c
269
buf->alloc = rlen;
usr.bin/ssh/sshbuf.c
272
if (max_size < buf->alloc)
usr.bin/ssh/sshbuf.c
33
buf->size, buf->alloc, buf->off, buf->max_size); \
usr.bin/ssh/sshbuf.c
342
if (len + buf->size <= buf->alloc)
usr.bin/ssh/sshbuf.c
349
need = len + buf->size - buf->alloc;
usr.bin/ssh/sshbuf.c
350
rlen = ROUNDUP(buf->alloc + need, SSHBUF_SIZE_INC);
usr.bin/ssh/sshbuf.c
353
rlen = buf->alloc + need;
usr.bin/ssh/sshbuf.c
355
if ((dp = recallocarray(buf->d, buf->alloc, rlen, 1)) == NULL) {
usr.bin/ssh/sshbuf.c
359
buf->alloc = rlen;
usr.bin/ssh/sshbuf.c
46
size_t alloc; /* Total bytes allocated to buf->d */
usr.bin/ssh/sshbuf.c
62
buf->alloc > buf->max_size ||
usr.bin/ssh/sshbuf.c
63
buf->size > buf->alloc ||
usr.bin/ssh/sshbuf.c
97
ret->alloc = SSHBUF_SIZE_INIT;
usr.bin/ssh/sshkey.c
676
if (impl != NULL && impl->funcs->alloc != NULL) {
usr.bin/ssh/sshkey.c
677
if (impl->funcs->alloc(k) != 0) {
usr.bin/ssh/sshkey.h
146
int (*alloc)(struct sshkey *); /* optional */
usr.sbin/amd/amd/mapc.c
127
short alloc; /* Allocation mode */
usr.sbin/amd/amd/mapc.c
383
int alloc = 0;
usr.sbin/amd/amd/mapc.c
385
(void) cmdoption(opt, mapc_opt, &alloc);
usr.sbin/amd/amd/mapc.c
392
m->flags = alloc & ~MAPC_CACHE_MASK;
usr.sbin/amd/amd/mapc.c
393
alloc &= MAPC_CACHE_MASK;
usr.sbin/amd/amd/mapc.c
395
if (alloc == MAPC_DFLT)
usr.sbin/amd/amd/mapc.c
396
alloc = mt->def_alloc;
usr.sbin/amd/amd/mapc.c
397
switch (alloc) {
usr.sbin/amd/amd/mapc.c
400
alloc = MAPC_INC;
usr.sbin/amd/amd/mapc.c
413
alloc = MAPC_INC;
usr.sbin/amd/amd/mapc.c
429
m->alloc = alloc;
usr.sbin/amd/amd/mapc.c
432
m->search = alloc >= MAPC_ALL ? error_search : mt->search;
usr.sbin/amd/amd/mapc.c
600
} else if (m->alloc >= MAPC_ALL) {
usr.sbin/amd/amd/mapc.c
613
if (!error && m->alloc == MAPC_INC)
usr.sbin/amd/amd/mapc.c
66
#define MAPC_ISRE(m) ((m)->alloc == MAPC_RE)
usr.sbin/amd/amd/mapc.c
666
if (m->alloc != MAPC_ROOT) {
usr.sbin/amd/amd/mapc.c
669
if (m->alloc >= MAPC_ALL)
usr.sbin/amd/amd/mapc.c
671
m->alloc = MAPC_INC;
usr.sbin/amd/amd/mapc.c
675
if (m->alloc < MAPC_ALL)
usr.sbin/config/gram.y
442
for (np = alloc, i = adepth; --i >= 0; np++)
usr.sbin/config/gram.y
66
static struct nvlist *alloc[1000];
usr.sbin/config/gram.y
68
#define new0(n,s,p,i,x) (alloc[adepth++] = newnv(n, s, p, i, x))
usr.sbin/lpd/proc.c
358
size_t alloc;
usr.sbin/lpd/proc.c
364
alloc = p->m_out.alloc ? p->m_out.alloc : 128;
usr.sbin/lpd/proc.c
365
while (p->m_out.pos + len > alloc)
usr.sbin/lpd/proc.c
366
alloc *= 2;
usr.sbin/lpd/proc.c
367
if (alloc != p->m_out.alloc) {
usr.sbin/lpd/proc.c
368
tmp = recallocarray(p->m_out.buf, p->m_out.alloc, alloc, 1);
usr.sbin/lpd/proc.c
371
p->m_out.alloc = alloc;
usr.sbin/lpd/proc.c
51
size_t alloc;
usr.sbin/nsd/server.c
1757
udb_alloc_delete(nsd->task[1-nsd->mytask]->alloc);
usr.sbin/nsd/server.c
1758
nsd->task[1-nsd->mytask]->alloc = NULL;
usr.sbin/nsd/udb.c
1006
assert(alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP]);
usr.sbin/nsd/udb.c
1010
else alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP] = fp->next;
usr.sbin/nsd/udb.c
1017
udb_alloc_pop_fl(void* base, udb_alloc* alloc, int exp)
usr.sbin/nsd/udb.c
1019
udb_void f = alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP];
usr.sbin/nsd/udb.c
1025
alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP] = fp->next;
usr.sbin/nsd/udb.c
1034
udb_alloc_push_fl(void* base, udb_alloc* alloc, udb_void f, int exp)
usr.sbin/nsd/udb.c
1042
fp->next = alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP];
usr.sbin/nsd/udb.c
1046
alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP] = f;
usr.sbin/nsd/udb.c
1051
udb_alloc_push_fl_noinit(void* base, udb_alloc* alloc, udb_void f, int exp)
usr.sbin/nsd/udb.c
1059
fp->next = alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP];
usr.sbin/nsd/udb.c
1062
alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP] = f;
usr.sbin/nsd/udb.c
1067
grow_align(void* base, udb_alloc* alloc, uint64_t esz)
usr.sbin/nsd/udb.c
1069
while( (alloc->disk->nextgrow & (esz-1)) != 0) {
usr.sbin/nsd/udb.c
1072
int fexp = udb_exp_offset(alloc->disk->nextgrow);
usr.sbin/nsd/udb.c
1074
udb_void f = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1075
udb_void fn = alloc->disk->nextgrow+fsz;
usr.sbin/nsd/udb.c
1076
assert(fn <= alloc->udb->base_size);
usr.sbin/nsd/udb.c
1077
alloc->disk->stat_free += fsz;
usr.sbin/nsd/udb.c
1078
udb_alloc_push_fl(base, alloc, f, fexp);
usr.sbin/nsd/udb.c
1080
alloc->disk->nextgrow = fn;
usr.sbin/nsd/udb.c
1086
grow_chunks(void* base, udb_alloc* alloc, size_t sz, int exp)
usr.sbin/nsd/udb.c
1090
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1091
grow_align(base, alloc, esz);
usr.sbin/nsd/udb.c
1093
ret = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1102
alloc->disk->stat_alloc += esz;
usr.sbin/nsd/udb.c
1103
alloc->disk->stat_data += sz;
usr.sbin/nsd/udb.c
1105
alloc->disk->nextgrow += esz;
usr.sbin/nsd/udb.c
1106
assert(alloc->disk->nextgrow <= alloc->udb->base_size);
usr.sbin/nsd/udb.c
1107
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1113
grow_end_calc(udb_alloc* alloc, int exp)
usr.sbin/nsd/udb.c
1116
uint64_t ng = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1132
grow_extra_check(udb_alloc* alloc, uint64_t ge)
usr.sbin/nsd/udb.c
1135
uint64_t bsz = alloc->udb->base_size;
usr.sbin/nsd/udb.c
1154
enough_free(udb_alloc* alloc)
usr.sbin/nsd/udb.c
1156
if(alloc->udb->base_size <= 2*1024*1024) {
usr.sbin/nsd/udb.c
1159
if(((size_t)alloc->disk->nextgrow)*3 <= alloc->udb->base_size)
usr.sbin/nsd/udb.c
1164
uint64_t space = alloc->udb->base_size - alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1165
if(space >= 1024*1024 && (space*4 >= alloc->udb->base_size
usr.sbin/nsd/udb.c
1166
|| alloc->udb->base_size < 4*1024*1024))
usr.sbin/nsd/udb.c
1174
udb_alloc_grow_space(void* base, udb_alloc* alloc, size_t sz, int exp)
usr.sbin/nsd/udb.c
1183
uint64_t grow_end = grow_end_calc(alloc, exp);
usr.sbin/nsd/udb.c
1184
assert(alloc->udb->base_size >= alloc->disk->nextgrow);
usr.sbin/nsd/udb.c
1185
if(grow_end <= alloc->udb->base_size) {
usr.sbin/nsd/udb.c
1187
return grow_chunks(base, alloc, sz, exp);
usr.sbin/nsd/udb.c
1192
grow_end = grow_extra_check(alloc, grow_end);
usr.sbin/nsd/udb.c
1193
if(!(base=udb_base_grow_and_remap(alloc->udb, grow_end))) {
usr.sbin/nsd/udb.c
1197
assert(grow_end <= alloc->udb->base_size);
usr.sbin/nsd/udb.c
1198
assert(alloc->udb->glob_data->fsize == alloc->udb->base_size);
usr.sbin/nsd/udb.c
1199
return grow_chunks(base, alloc, sz, exp);
usr.sbin/nsd/udb.c
1204
grow_xl(void* base, udb_alloc* alloc, uint64_t xlsz, uint64_t sz)
usr.sbin/nsd/udb.c
1208
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1211
grow_align(base, alloc, UDB_ALLOC_CHUNK_SIZE);
usr.sbin/nsd/udb.c
1214
ret = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1227
alloc->disk->stat_data += sz;
usr.sbin/nsd/udb.c
1228
alloc->disk->stat_alloc += xlsz;
usr.sbin/nsd/udb.c
1230
alloc->disk->nextgrow += xlsz;
usr.sbin/nsd/udb.c
1231
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1237
udb_alloc_xl_space(void* base, udb_alloc* alloc, size_t sz)
usr.sbin/nsd/udb.c
1242
uint64_t grow_end = grow_end_calc(alloc, UDB_ALLOC_CHUNKS_MAX) + need;
usr.sbin/nsd/udb.c
1244
if(grow_end <= alloc->udb->base_size) {
usr.sbin/nsd/udb.c
1246
return grow_xl(base, alloc, need, sz);
usr.sbin/nsd/udb.c
1249
grow_end = grow_extra_check(alloc, grow_end);
usr.sbin/nsd/udb.c
1250
if(!(base=udb_base_grow_and_remap(alloc->udb, grow_end))) {
usr.sbin/nsd/udb.c
1254
assert(grow_end <= alloc->udb->base_size);
usr.sbin/nsd/udb.c
1255
assert(alloc->udb->glob_data->fsize == alloc->udb->base_size);
usr.sbin/nsd/udb.c
1256
return grow_xl(base, alloc, need, sz);
usr.sbin/nsd/udb.c
1261
udb_alloc_subdivide(void* base, udb_alloc* alloc, udb_void big, int e2,
usr.sbin/nsd/udb.c
1272
udb_alloc_push_fl(base, alloc, big+sz, e);
usr.sbin/nsd/udb.c
1294
udb_void udb_alloc_space(udb_alloc* alloc, size_t sz)
usr.sbin/nsd/udb.c
1296
void* base = alloc->udb->base;
usr.sbin/nsd/udb.c
1300
return udb_alloc_xl_space(base, alloc, sz);
usr.sbin/nsd/udb.c
1302
if(alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP]) {
usr.sbin/nsd/udb.c
1305
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1306
ret = udb_alloc_pop_fl(base, alloc, exp);
usr.sbin/nsd/udb.c
1312
alloc->disk->stat_data += sz;
usr.sbin/nsd/udb.c
1313
alloc->disk->stat_alloc += (1<<exp);
usr.sbin/nsd/udb.c
1314
assert(alloc->disk->stat_free >= (1u<<exp));
usr.sbin/nsd/udb.c
1315
alloc->disk->stat_free -= (1<<exp);
usr.sbin/nsd/udb.c
1316
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1321
if(alloc->disk->free[e2-UDB_ALLOC_CHUNK_MINEXP]) {
usr.sbin/nsd/udb.c
1323
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1324
big = udb_alloc_pop_fl(base, alloc, e2);
usr.sbin/nsd/udb.c
1326
ret = udb_alloc_subdivide(base, alloc, big, e2, exp);
usr.sbin/nsd/udb.c
1337
alloc->disk->stat_data += sz;
usr.sbin/nsd/udb.c
1338
alloc->disk->stat_alloc += (1<<exp);
usr.sbin/nsd/udb.c
1339
assert(alloc->disk->stat_free >= (1u<<exp));
usr.sbin/nsd/udb.c
1340
alloc->disk->stat_free -= (1<<exp);
usr.sbin/nsd/udb.c
1341
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1345
return udb_alloc_grow_space(base, alloc, sz, exp);
usr.sbin/nsd/udb.c
1350
have_free_for(udb_alloc* alloc, int exp)
usr.sbin/nsd/udb.c
1353
if(alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP])
usr.sbin/nsd/udb.c
1356
if(alloc->disk->free[e2-UDB_ALLOC_CHUNK_MINEXP]) {
usr.sbin/nsd/udb.c
1400
move_chunk(void* base, udb_alloc* alloc, udb_void f, int exp, uint64_t esz,
usr.sbin/nsd/udb.c
1403
udb_void res = udb_alloc_pop_fl(base, alloc, e2);
usr.sbin/nsd/udb.c
1408
res = udb_alloc_subdivide(base, alloc, res, e2, exp);
usr.sbin/nsd/udb.c
1412
alloc->udb->glob_data->rb_old = f;
usr.sbin/nsd/udb.c
1413
alloc->udb->glob_data->rb_new = res;
usr.sbin/nsd/udb.c
1414
alloc->udb->glob_data->rb_size = esz;
usr.sbin/nsd/udb.c
1421
chunk_fix_ptrs(base, alloc->udb, rp, res+sizeof(udb_chunk_d),
usr.sbin/nsd/udb.c
1429
free_xl_space(void* base, udb_alloc* alloc, udb_void s, uint64_t m)
usr.sbin/nsd/udb.c
1437
udb_alloc_unlink_fl(base, alloc, q, UDB_ALLOC_CHUNKS_MAX);
usr.sbin/nsd/udb.c
1475
move_xl_list(void* base, udb_alloc* alloc, udb_void xl_start, uint64_t xl_sz,
usr.sbin/nsd/udb.c
1487
move_xl_segment(base, alloc->udb, xl, n, sz, 0);
usr.sbin/nsd/udb.c
1488
chunk_fix_ptrs(base, alloc->udb, UDB_CHUNK(n),
usr.sbin/nsd/udb.c
1493
alloc->disk->stat_free -= amount;
usr.sbin/nsd/udb.c
1494
alloc->disk->nextgrow -= amount;
usr.sbin/nsd/udb.c
1495
alloc->udb->glob_data->rb_old = 0;
usr.sbin/nsd/udb.c
1496
alloc->udb->glob_data->rb_new = 0;
usr.sbin/nsd/udb.c
1497
alloc->udb->glob_data->rb_size = 0;
usr.sbin/nsd/udb.c
1502
coagulate_possible(void* base, udb_alloc* alloc, udb_void f, int exp,
usr.sbin/nsd/udb.c
1508
if(other >= alloc->udb->base_size)
usr.sbin/nsd/udb.c
1510
if(other >= alloc->disk->nextgrow)
usr.sbin/nsd/udb.c
1512
if(other < alloc->udb->glob_data->hsize)
usr.sbin/nsd/udb.c
1540
coagulate_and_push(void* base, udb_alloc* alloc, udb_void last, int exp,
usr.sbin/nsd/udb.c
1545
while( (other=coagulate_possible(base, alloc, last, exp, esz)) ) {
usr.sbin/nsd/udb.c
1547
udb_alloc_unlink_fl(base, alloc, other, exp);
usr.sbin/nsd/udb.c
1555
udb_alloc_push_fl(base, alloc, last, exp);
usr.sbin/nsd/udb.c
1561
udb_alloc_compact(void* base, udb_alloc* alloc)
usr.sbin/nsd/udb.c
1566
uint64_t at = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1569
if(alloc->udb->inhibit_compact)
usr.sbin/nsd/udb.c
1571
alloc->udb->useful_compact = 0;
usr.sbin/nsd/udb.c
1572
while(at > alloc->udb->glob_data->hsize) {
usr.sbin/nsd/udb.c
1595
alloc->udb->glob_data->dirty_alloc = udb_dirty_compact;
usr.sbin/nsd/udb.c
1596
free_xl_space(base, alloc, xl+xlsz, m);
usr.sbin/nsd/udb.c
1597
move_xl_list(base, alloc, xl_start, xl_sz, m);
usr.sbin/nsd/udb.c
1598
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1616
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1617
udb_alloc_unlink_fl(base, alloc, last, exp);
usr.sbin/nsd/udb.c
1618
alloc->disk->stat_free -= esz;
usr.sbin/nsd/udb.c
1619
alloc->disk->nextgrow = last;
usr.sbin/nsd/udb.c
1620
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1624
} else if( (e2=have_free_for(alloc, exp)) ) {
usr.sbin/nsd/udb.c
1627
alloc->udb->glob_data->dirty_alloc = udb_dirty_compact;
usr.sbin/nsd/udb.c
1628
move_chunk(base, alloc, last, exp, esz, e2);
usr.sbin/nsd/udb.c
1630
last = coagulate_and_push(base, alloc,
usr.sbin/nsd/udb.c
1634
alloc->disk->stat_free -= esz;
usr.sbin/nsd/udb.c
1635
alloc->disk->nextgrow = last;
usr.sbin/nsd/udb.c
1637
alloc->udb->glob_data->rb_old = 0;
usr.sbin/nsd/udb.c
1638
alloc->udb->glob_data->rb_new = 0;
usr.sbin/nsd/udb.c
1639
alloc->udb->glob_data->rb_size = 0;
usr.sbin/nsd/udb.c
1640
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1672
alloc->udb->glob_data->dirty_alloc = udb_dirty_compact;
usr.sbin/nsd/udb.c
1673
free_xl_space(base, alloc, at, m);
usr.sbin/nsd/udb.c
1674
move_xl_list(base, alloc, xl_start, xl_sz, m);
usr.sbin/nsd/udb.c
1675
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1680
if(enough_free(alloc)) {
usr.sbin/nsd/udb.c
1681
uint64_t nsize = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
1682
udb_base_shrink(alloc->udb, nsize);
usr.sbin/nsd/udb.c
1683
if(!udb_base_remap(alloc->udb, alloc, nsize))
usr.sbin/nsd/udb.c
1695
return udb_alloc_compact(udb->base, udb->alloc);
usr.sbin/nsd/udb.c
1716
udb_free_xl(void* base, udb_alloc* alloc, udb_void f, udb_xl_chunk_d* fp,
usr.sbin/nsd/udb.c
1728
(*alloc->udb->walkfunc)(base, alloc->udb->walkarg, fp->type,
usr.sbin/nsd/udb.c
1732
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1734
alloc->disk->stat_data -= sz;
usr.sbin/nsd/udb.c
1735
alloc->disk->stat_alloc -= xlsz;
usr.sbin/nsd/udb.c
1736
alloc->disk->stat_free += xlsz;
usr.sbin/nsd/udb.c
1743
udb_alloc_push_fl(base, alloc, c, UDB_ALLOC_CHUNKS_MAX);
usr.sbin/nsd/udb.c
1746
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1749
int udb_alloc_free(udb_alloc* alloc, udb_void r, size_t sz)
usr.sbin/nsd/udb.c
1763
base = alloc->udb->base;
usr.sbin/nsd/udb.c
1778
udb_free_xl(base, alloc, f, (udb_xl_chunk_d*)fp, sz);
usr.sbin/nsd/udb.c
1780
if(alloc->udb->inhibit_compact) {
usr.sbin/nsd/udb.c
1781
alloc->udb->useful_compact = 1;
usr.sbin/nsd/udb.c
1784
return udb_alloc_compact(base, alloc);
usr.sbin/nsd/udb.c
1794
(*alloc->udb->walkfunc)(base, alloc->udb->walkarg, fp->type,
usr.sbin/nsd/udb.c
1799
alloc->udb->glob_data->dirty_alloc = udb_dirty_fl;
usr.sbin/nsd/udb.c
1800
alloc->disk->stat_data -= sz;
usr.sbin/nsd/udb.c
1801
alloc->disk->stat_free += esz;
usr.sbin/nsd/udb.c
1802
alloc->disk->stat_alloc -= esz;
usr.sbin/nsd/udb.c
1805
while( (other=coagulate_possible(base, alloc, f, exp, esz)) ) {
usr.sbin/nsd/udb.c
1808
udb_alloc_unlink_fl(base, alloc, other, exp);
usr.sbin/nsd/udb.c
1817
udb_alloc_push_fl(base, alloc, f, exp);
usr.sbin/nsd/udb.c
1823
udb_alloc_push_fl_noinit(base, alloc, f, exp);
usr.sbin/nsd/udb.c
1825
alloc->udb->glob_data->dirty_alloc = udb_dirty_clean;
usr.sbin/nsd/udb.c
1827
if(alloc->udb->inhibit_compact) {
usr.sbin/nsd/udb.c
1828
alloc->udb->useful_compact = 1;
usr.sbin/nsd/udb.c
1831
return udb_alloc_compact(base, alloc);
usr.sbin/nsd/udb.c
1834
udb_void udb_alloc_init(udb_alloc* alloc, void* d, size_t sz)
usr.sbin/nsd/udb.c
1837
udb_void r = udb_alloc_space(alloc, sz);
usr.sbin/nsd/udb.c
1839
memcpy(UDB_REL(alloc->udb->base, r), d, sz);
usr.sbin/nsd/udb.c
1843
udb_void udb_alloc_realloc(udb_alloc* alloc, udb_void r, size_t osz, size_t sz)
usr.sbin/nsd/udb.c
1845
void* base = alloc->udb->base;
usr.sbin/nsd/udb.c
1852
return udb_alloc_space(alloc, sz);
usr.sbin/nsd/udb.c
1854
if(!udb_alloc_free(alloc, r, osz))
usr.sbin/nsd/udb.c
1870
newd = udb_alloc_space(alloc, sz);
usr.sbin/nsd/udb.c
1873
base = alloc->udb->base;
usr.sbin/nsd/udb.c
1880
chunk_fix_ptrs(base, alloc->udb, np, newd, osz, r);
usr.sbin/nsd/udb.c
1882
if(!udb_alloc_free(alloc, r, osz))
usr.sbin/nsd/udb.c
1887
int udb_alloc_grow(udb_alloc* alloc, size_t sz, size_t num)
usr.sbin/nsd/udb.c
1897
want = grow_end_calc(alloc, exp) + esz*(num-1);
usr.sbin/nsd/udb.c
1898
assert(want >= alloc->udb->base_size);
usr.sbin/nsd/udb.c
1899
if(!udb_base_grow_and_remap(alloc->udb, want)) {
usr.sbin/nsd/udb.c
1906
void udb_alloc_set_type(udb_alloc* alloc, udb_void r, udb_chunk_type tp)
usr.sbin/nsd/udb.c
1908
void* base = alloc->udb->base;
usr.sbin/nsd/udb.c
1923
(to+destsize) <= udb->alloc->disk->nextgrow);
usr.sbin/nsd/udb.c
200
udb->alloc = udb_alloc_create(udb, (udb_alloc_d*)(
usr.sbin/nsd/udb.c
202
if(!udb->alloc) {
usr.sbin/nsd/udb.c
2077
r = udb_alloc_space(udb->alloc, sz);
usr.sbin/nsd/udb.c
2079
udb_alloc_set_type(udb->alloc, r, type);
usr.sbin/nsd/udb.c
209
udb_alloc_compact(udb, udb->alloc);
usr.sbin/nsd/udb.c
2090
udb_alloc_free(udb->alloc, d, sz);
usr.sbin/nsd/udb.c
320
if(udb->fd != -1 && udb->base && udb->alloc) {
usr.sbin/nsd/udb.c
321
uint64_t nsize = udb->alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
34
static int udb_alloc_compact(void* base, udb_alloc* alloc);
usr.sbin/nsd/udb.c
345
udb_alloc_delete(udb->alloc);
usr.sbin/nsd/udb.c
359
udb_alloc_delete(udb->alloc);
usr.sbin/nsd/udb.c
517
udb_base_remap(udb_base* udb, udb_alloc* alloc, uint64_t nsize)
usr.sbin/nsd/udb.c
561
alloc->disk = (udb_alloc_d*)((char*)udb->glob_data
usr.sbin/nsd/udb.c
567
(void)udb; (void)alloc; (void)nsize;
usr.sbin/nsd/udb.c
576
udb_base_remap(udb, udb->alloc, udb->glob_data->fsize);
usr.sbin/nsd/udb.c
609
return udb_base_remap(udb, udb->alloc, nsize);
usr.sbin/nsd/udb.c
670
fsck_fsize(udb_base* udb, udb_alloc* alloc)
usr.sbin/nsd/udb.c
680
if(!udb_base_remap(udb, alloc, (uint64_t)realsize))
usr.sbin/nsd/udb.c
772
regen_ptrlist(void* base, udb_base* udb, udb_alloc* alloc,
usr.sbin/nsd/udb.c
775
udb_void at = alloc->udb->glob_data->hsize;
usr.sbin/nsd/udb.c
777
while(at < alloc->disk->nextgrow) {
usr.sbin/nsd/udb.c
791
at = alloc->udb->glob_data->hsize;
usr.sbin/nsd/udb.c
792
while(at < alloc->disk->nextgrow) {
usr.sbin/nsd/udb.c
886
fsck_file(udb_base* udb, udb_alloc* alloc, int moved)
usr.sbin/nsd/udb.c
900
if(rb_old+rb_size <= alloc->disk->nextgrow
usr.sbin/nsd/udb.c
901
&& rb_new+rb_size <= alloc->disk->nextgrow) {
usr.sbin/nsd/udb.c
921
regen.nextgrow = alloc->disk->nextgrow;
usr.sbin/nsd/udb.c
945
*alloc->disk = regen;
usr.sbin/nsd/udb.c
948
regen_ptrlist(base, udb, alloc, rb_old, rb_new);
usr.sbin/nsd/udb.c
963
udb_alloc* alloc = (udb_alloc*)xalloc_zero(sizeof(*alloc));
usr.sbin/nsd/udb.c
964
if(!alloc)
usr.sbin/nsd/udb.c
966
alloc->udb = udb;
usr.sbin/nsd/udb.c
967
alloc->disk = disk;
usr.sbin/nsd/udb.c
972
if(fsck_fsize(udb, alloc))
usr.sbin/nsd/udb.c
973
return alloc;
usr.sbin/nsd/udb.c
975
if(fsck_file(udb, alloc, 0))
usr.sbin/nsd/udb.c
976
return alloc;
usr.sbin/nsd/udb.c
978
if(fsck_file(udb, alloc, 1))
usr.sbin/nsd/udb.c
979
return alloc;
usr.sbin/nsd/udb.c
983
free(alloc);
usr.sbin/nsd/udb.c
986
return alloc;
usr.sbin/nsd/udb.c
989
void udb_alloc_delete(udb_alloc* alloc)
usr.sbin/nsd/udb.c
991
if(!alloc) return;
usr.sbin/nsd/udb.c
992
free(alloc);
usr.sbin/nsd/udb.c
997
udb_alloc_unlink_fl(void* base, udb_alloc* alloc, udb_void chunk, int exp)
usr.sbin/nsd/udb.h
191
udb_alloc* alloc;
usr.sbin/nsd/udb.h
493
void udb_alloc_delete(udb_alloc* alloc);
usr.sbin/nsd/udb.h
502
udb_void udb_alloc_space(udb_alloc* alloc, size_t sz);
usr.sbin/nsd/udb.h
512
udb_void udb_alloc_init(udb_alloc* alloc, void* d, size_t sz);
usr.sbin/nsd/udb.h
522
int udb_alloc_free(udb_alloc* alloc, udb_void r, size_t sz);
usr.sbin/nsd/udb.h
537
udb_void udb_alloc_realloc(udb_alloc* alloc, udb_void r, size_t osz,
usr.sbin/nsd/udb.h
549
int udb_alloc_grow(udb_alloc* alloc, size_t sz, size_t num);
usr.sbin/nsd/udb.h
573
void udb_alloc_set_type(udb_alloc* alloc, udb_void r, udb_chunk_type tp);
usr.sbin/nsd/udb.h
799
udb_alloc_free(udb->alloc, d, sz);
usr.sbin/smtpd/mproc.c
277
size_t alloc;
usr.sbin/smtpd/mproc.c
285
alloc = p->m_alloc ? p->m_alloc : 128;
usr.sbin/smtpd/mproc.c
286
while (p->m_pos + len > alloc)
usr.sbin/smtpd/mproc.c
287
alloc *= 2;
usr.sbin/smtpd/mproc.c
288
if (alloc != p->m_alloc) {
usr.sbin/smtpd/mproc.c
293
alloc);
usr.sbin/smtpd/mproc.c
295
tmp = recallocarray(p->m_buf, p->m_alloc, alloc, 1);
usr.sbin/smtpd/mproc.c
298
p->m_alloc = alloc;
usr.sbin/smtpd/rfc5322.c
219
size_t alloc;
usr.sbin/smtpd/rfc5322.c
230
alloc = N * (need / N) + ((need % N) ? N : 0);
usr.sbin/smtpd/rfc5322.c
232
buf = reallocarray(b->buf, alloc, 1);
usr.sbin/smtpd/rfc5322.c
237
b->bufsz = alloc;
usr.sbin/smtpd/smtpc.c
130
size_t alloc = 0;
usr.sbin/smtpd/smtpc.c
175
if ((len = getline(&authstr, &alloc, authfile)) == -1)
usr.sbin/smtpd/smtpc.c
182
if ((len = getline(&authstr, &alloc, authfile)) == -1)
usr.sbin/smtpd/smtpctl.c
405
static int n, tmpalloc, alloc = 0;
usr.sbin/smtpd/smtpctl.c
411
if (n == alloc) {
usr.sbin/smtpd/smtpctl.c
412
tmpalloc = alloc ? (alloc * 2) : 128;
usr.sbin/smtpd/smtpctl.c
413
tmp = recallocarray(evpids, alloc, tmpalloc,
usr.sbin/smtpd/smtpctl.c
418
alloc = tmpalloc;
usr.sbin/unbound/cachedb/redis.c
369
moddata->ctxs[env->alloc->thread_num] != NULL) {
usr.sbin/unbound/cachedb/redis.c
439
log_assert(env->alloc->thread_num < d->numctxs);
usr.sbin/unbound/cachedb/redis.c
444
ctx = ctx_selector[env->alloc->thread_num];
usr.sbin/unbound/cachedb/redis.c
481
ctx_selector[env->alloc->thread_num] = ctx;
usr.sbin/unbound/cachedb/redis.c
493
ctx_selector[env->alloc->thread_num] = NULL;
usr.sbin/unbound/daemon/cachedump.c
514
ak = alloc_special_obtain(worker->alloc);
usr.sbin/unbound/daemon/cachedump.c
525
ub_packed_rrset_parsedelete(ak, worker->alloc);
usr.sbin/unbound/daemon/cachedump.c
535
ub_packed_rrset_parsedelete(ak, worker->alloc);
usr.sbin/unbound/daemon/cachedump.c
558
worker->alloc, *worker->env.now);
usr.sbin/unbound/daemon/daemon.c
450
daemon->env->alloc = &daemon->superalloc;
usr.sbin/unbound/daemon/daemon.c
466
daemon->env->alloc = &daemon->superalloc;
usr.sbin/unbound/daemon/daemon.c
600
struct alloc_cache* alloc = calloc(1,
usr.sbin/unbound/daemon/daemon.c
602
if (!alloc)
usr.sbin/unbound/daemon/daemon.c
604
alloc_init(alloc, &daemon->superalloc, i);
usr.sbin/unbound/daemon/daemon.c
605
daemon->worker_allocs[i] = alloc;
usr.sbin/unbound/daemon/worker.c
138
ac = alloc_get_mem(worker->alloc);
usr.sbin/unbound/daemon/worker.c
2311
worker->alloc = worker->daemon->worker_allocs[worker->thread_num];
usr.sbin/unbound/daemon/worker.c
2312
alloc_set_id_cleanup(worker->alloc, &worker_alloc_cleanup, worker);
usr.sbin/unbound/daemon/worker.c
2318
worker->env.alloc = worker->alloc;
usr.sbin/unbound/daemon/worker.h
127
struct alloc_cache *alloc;
usr.sbin/unbound/edns-subnet/subnetmod.c
234
alloc_init(&sn_env->alloc, NULL, 0);
usr.sbin/unbound/edns-subnet/subnetmod.c
307
alloc_clear(&sn_env->alloc);
usr.sbin/unbound/edns-subnet/subnetmod.c
327
reply_info_parsedelete(elem, &env->alloc);
usr.sbin/unbound/edns-subnet/subnetmod.c
429
lock_quick_lock(&sne->alloc.lock);
usr.sbin/unbound/edns-subnet/subnetmod.c
430
rep = reply_info_copy(qstate->return_msg->rep, &sne->alloc, NULL);
usr.sbin/unbound/edns-subnet/subnetmod.c
431
lock_quick_unlock(&sne->alloc.lock);
usr.sbin/unbound/edns-subnet/subnetmod.h
63
struct alloc_cache alloc;
usr.sbin/unbound/iterator/iter_scrub.c
791
k = alloc_special_obtain(env->alloc);
usr.sbin/unbound/iterator/iter_scrub.c
796
alloc_special_release(env->alloc, k);
usr.sbin/unbound/iterator/iter_scrub.c
804
(void)rrset_cache_update(env->rrset_cache, &ref, env->alloc, now);
usr.sbin/unbound/iterator/iter_utils.c
1172
rrset = packed_rrset_copy_alloc(rrset, env->alloc, *env->now);
usr.sbin/unbound/iterator/iter_utils.c
1182
(void)rrset_cache_update(env->rrset_cache, &ref, env->alloc, *env->now);
usr.sbin/unbound/libunbound/context.c
111
ctx->env->cfg, ctx->env->alloc);
usr.sbin/unbound/libunbound/context.c
224
context_release_alloc(struct ub_ctx* ctx, struct alloc_cache* alloc,
usr.sbin/unbound/libunbound/context.c
227
if(!ctx || !alloc)
usr.sbin/unbound/libunbound/context.c
232
alloc->super = ctx->alloc_list;
usr.sbin/unbound/libunbound/context.c
233
ctx->alloc_list = alloc;
usr.sbin/unbound/libunbound/context.h
249
void context_release_alloc(struct ub_ctx* ctx, struct alloc_cache* alloc,
usr.sbin/unbound/libunbound/libunbound.c
172
ctx->env->alloc = &ctx->superalloc;
usr.sbin/unbound/libunbound/libworker.c
146
w->env->alloc = context_obtain_alloc(ctx, !w->is_bg || w->is_bg_thread);
usr.sbin/unbound/libunbound/libworker.c
147
if(!w->env->alloc) {
usr.sbin/unbound/libunbound/libworker.c
151
w->thread_num = w->env->alloc->thread_num;
usr.sbin/unbound/libunbound/libworker.c
152
alloc_set_id_cleanup(w->env->alloc, &libworker_alloc_cleanup, w);
usr.sbin/unbound/libunbound/libworker.c
97
context_release_alloc(w->ctx, w->env->alloc,
usr.sbin/unbound/services/cache/dns.c
1130
rep = reply_info_copy(msgrep, env->alloc, NULL);
usr.sbin/unbound/services/cache/dns.c
1148
env->alloc,
usr.sbin/unbound/services/cache/dns.c
1162
reply_info_parsedelete(rep, env->alloc);
usr.sbin/unbound/services/cache/dns.c
203
slabhash_insert(env->msg_cache, hash, &e->entry, rep, env->alloc);
usr.sbin/unbound/services/cache/dns.c
90
env->alloc, ((ntohs(rep->ref[i].key->rk.type)==
usr.sbin/unbound/services/cache/rrset.c
177
rrset_update_id(struct rrset_ref* ref, struct alloc_cache* alloc)
usr.sbin/unbound/services/cache/rrset.c
180
uint64_t newid = alloc_get_id(alloc);
usr.sbin/unbound/services/cache/rrset.c
193
struct alloc_cache* alloc, time_t timenow)
usr.sbin/unbound/services/cache/rrset.c
219
ub_packed_rrset_parsedelete(k, alloc);
usr.sbin/unbound/services/cache/rrset.c
233
slabhash_insert(&r->table, h, &k->entry, k->entry.data, alloc);
usr.sbin/unbound/services/cache/rrset.c
241
rrset_update_id(ref, alloc);
usr.sbin/unbound/services/cache/rrset.c
250
struct alloc_cache* alloc, time_t timenow)
usr.sbin/unbound/services/cache/rrset.c
254
rrset = packed_rrset_copy_alloc(rrset, alloc, timenow);
usr.sbin/unbound/services/cache/rrset.c
269
alloc_special_release(alloc, rrset);
usr.sbin/unbound/services/cache/rrset.c
278
(void)rrset_cache_update(rrset_cache, &ref, alloc, timenow);
usr.sbin/unbound/services/cache/rrset.c
62
struct alloc_cache* alloc)
usr.sbin/unbound/services/cache/rrset.c
70
ub_rrset_key_delete, rrset_data_delete, alloc);
usr.sbin/unbound/services/cache/rrset.c
86
struct config_file* cfg, struct alloc_cache* alloc)
usr.sbin/unbound/services/cache/rrset.c
92
r = rrset_cache_create(cfg, alloc);
usr.sbin/unbound/services/cache/rrset.h
134
struct alloc_cache* alloc, time_t timenow);
usr.sbin/unbound/services/cache/rrset.h
152
struct alloc_cache* alloc, time_t timenow);
usr.sbin/unbound/services/cache/rrset.h
68
struct alloc_cache* alloc);
usr.sbin/unbound/services/cache/rrset.h
86
struct config_file* cfg, struct alloc_cache* alloc);
usr.sbin/unbound/services/mesh.c
1004
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/mesh.c
1094
alloc_reg_release(mstate->s.env->alloc, mstate->s.region);
usr.sbin/unbound/services/mesh.c
967
struct regional* region = alloc_reg_obtain(env->alloc);
usr.sbin/unbound/services/mesh.c
975
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/mesh.c
998
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/outside_network.c
1839
alloc_reg_release(sq->alloc, sq->region);
usr.sbin/unbound/services/outside_network.c
2631
size_t pad_queries_block_size, struct alloc_cache* alloc,
usr.sbin/unbound/services/outside_network.c
2640
alloc_reg_release(alloc, region);
usr.sbin/unbound/services/outside_network.c
2644
sq->alloc = alloc;
usr.sbin/unbound/services/outside_network.c
2649
alloc_reg_release(alloc, region);
usr.sbin/unbound/services/outside_network.c
2656
alloc_reg_release(alloc, region);
usr.sbin/unbound/services/outside_network.c
2670
alloc_reg_release(alloc, region);
usr.sbin/unbound/services/outside_network.c
2683
alloc_reg_release(alloc, region);
usr.sbin/unbound/services/outside_network.c
3444
region = alloc_reg_obtain(env->alloc);
usr.sbin/unbound/services/outside_network.c
3450
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/outside_network.c
3458
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/outside_network.c
3493
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/outside_network.c
3509
env->alloc, region);
usr.sbin/unbound/services/outside_network.c
3531
alloc_reg_release(env->alloc, region);
usr.sbin/unbound/services/outside_network.h
525
struct alloc_cache* alloc;
usr.sbin/unbound/testcode/memstats.c
119
cl->alloc = 0;
usr.sbin/unbound/testcode/memstats.c
147
cl->alloc += num;
usr.sbin/unbound/testcode/memstats.c
173
cl->alloc += num*sz;
usr.sbin/unbound/testcode/memstats.c
231
printf("%12lld / %8lld in %s %s\n", (long long)cl->alloc,
usr.sbin/unbound/testcode/memstats.c
233
total += cl->alloc;
usr.sbin/unbound/testcode/memstats.c
60
uint64_t alloc;
usr.sbin/unbound/testcode/unitmsgparse.c
200
perftestpkt(sldns_buffer* pkt, struct alloc_cache* alloc, sldns_buffer* out,
usr.sbin/unbound/testcode/unitmsgparse.c
218
ret = reply_info_parse(pkt, alloc, &qi, &rep, region, &edns);
usr.sbin/unbound/testcode/unitmsgparse.c
231
reply_info_parsedelete(rep, alloc);
usr.sbin/unbound/testcode/unitmsgparse.c
314
testpkt(sldns_buffer* pkt, struct alloc_cache* alloc, sldns_buffer* out,
usr.sbin/unbound/testcode/unitmsgparse.c
332
ret = reply_info_parse(pkt, alloc, &qi, &rep, region, &edns);
usr.sbin/unbound/testcode/unitmsgparse.c
377
reply_info_parsedelete(rep, alloc);
usr.sbin/unbound/testcode/unitmsgparse.c
383
simpletest(sldns_buffer* pkt, struct alloc_cache* alloc, sldns_buffer* out)
usr.sbin/unbound/testcode/unitmsgparse.c
386
testpkt(pkt, alloc, out,
usr.sbin/unbound/testcode/unitmsgparse.c
390
testpkt(pkt, alloc, out,
usr.sbin/unbound/testcode/unitmsgparse.c
402
testpkt(pkt, alloc, out,
usr.sbin/unbound/testcode/unitmsgparse.c
432
perftestpkt(pkt, alloc, out,
usr.sbin/unbound/testcode/unitmsgparse.c
440
testfromfile(sldns_buffer* pkt, struct alloc_cache* alloc, sldns_buffer* out,
usr.sbin/unbound/testcode/unitmsgparse.c
459
testpkt(pkt, alloc, out, buf);
usr.sbin/unbound/testcode/unitmsgparse.c
467
testfromdrillfile(sldns_buffer* pkt, struct alloc_cache* alloc,
usr.sbin/unbound/testcode/unitmsgparse.c
484
testpkt(pkt, alloc, out, buf);
usr.sbin/unbound/testcode/unitmsgparse.c
494
testpkt(pkt, alloc, out, buf);
usr.sbin/unbound/testcode/unitmsgparse.c
508
struct alloc_cache super_a, alloc;
usr.sbin/unbound/testcode/unitmsgparse.c
512
alloc_init(&alloc, &super_a, 2);
usr.sbin/unbound/testcode/unitmsgparse.c
515
simpletest(pkt, &alloc, out);
usr.sbin/unbound/testcode/unitmsgparse.c
517
testfromfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.1");
usr.sbin/unbound/testcode/unitmsgparse.c
518
testfromfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.2");
usr.sbin/unbound/testcode/unitmsgparse.c
519
testfromfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.3");
usr.sbin/unbound/testcode/unitmsgparse.c
521
testfromdrillfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.4");
usr.sbin/unbound/testcode/unitmsgparse.c
522
testfromdrillfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.5");
usr.sbin/unbound/testcode/unitmsgparse.c
525
testfromdrillfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.6");
usr.sbin/unbound/testcode/unitmsgparse.c
527
testfromdrillfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.7");
usr.sbin/unbound/testcode/unitmsgparse.c
532
testfromdrillfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.8");
usr.sbin/unbound/testcode/unitmsgparse.c
537
testfromdrillfile(pkt, &alloc, out, SRCDIRSTR "/testdata/test_packets.9");
usr.sbin/unbound/testcode/unitmsgparse.c
542
alloc_clear(&alloc);
usr.sbin/unbound/testcode/unitverify.c
101
lock_quick_lock(&alloc->lock);
usr.sbin/unbound/testcode/unitverify.c
102
ret = reply_info_parse(pkt, alloc, qi, rep, region, &edns);
usr.sbin/unbound/testcode/unitverify.c
103
lock_quick_unlock(&alloc->lock);
usr.sbin/unbound/testcode/unitverify.c
114
extract_keys(struct entry* e, struct alloc_cache* alloc,
usr.sbin/unbound/testcode/unitverify.c
122
entry_to_repinfo(e, alloc, region, pkt, &qinfo, &rep);
usr.sbin/unbound/testcode/unitverify.c
132
reply_info_parsedelete(rep, alloc);
usr.sbin/unbound/testcode/unitverify.c
214
verifytest_entry(struct entry* e, struct alloc_cache* alloc,
usr.sbin/unbound/testcode/unitverify.c
230
entry_to_repinfo(e, alloc, region, pkt, &qinfo, &rep);
usr.sbin/unbound/testcode/unitverify.c
236
reply_info_parsedelete(rep, alloc);
usr.sbin/unbound/testcode/unitverify.c
254
dstest_entry(struct entry* e, struct alloc_cache* alloc,
usr.sbin/unbound/testcode/unitverify.c
269
entry_to_repinfo(e, alloc, region, pkt, &qinfo, &rep);
usr.sbin/unbound/testcode/unitverify.c
291
reply_info_parsedelete(rep, alloc);
usr.sbin/unbound/testcode/unitverify.c
306
struct alloc_cache alloc;
usr.sbin/unbound/testcode/unitverify.c
317
alloc_init(&alloc, NULL, 1);
usr.sbin/unbound/testcode/unitverify.c
325
dnskey = extract_keys(list, &alloc, region, buf);
usr.sbin/unbound/testcode/unitverify.c
331
verifytest_entry(e, &alloc, region, buf, dnskey, &env, &ve);
usr.sbin/unbound/testcode/unitverify.c
334
ub_packed_rrset_parsedelete(dnskey, &alloc);
usr.sbin/unbound/testcode/unitverify.c
337
alloc_clear(&alloc);
usr.sbin/unbound/testcode/unitverify.c
351
struct alloc_cache alloc;
usr.sbin/unbound/testcode/unitverify.c
360
alloc_init(&alloc, NULL, 1);
usr.sbin/unbound/testcode/unitverify.c
368
dstest_entry(e, &alloc, region, buf, &env);
usr.sbin/unbound/testcode/unitverify.c
373
alloc_clear(&alloc);
usr.sbin/unbound/testcode/unitverify.c
429
struct alloc_cache* alloc, struct regional* region,
usr.sbin/unbound/testcode/unitverify.c
445
entry_to_repinfo(e, alloc, region, buf, &qinfo, &rep);
usr.sbin/unbound/testcode/unitverify.c
469
reply_info_parsedelete(rep, alloc);
usr.sbin/unbound/testcode/unitverify.c
490
struct alloc_cache alloc;
usr.sbin/unbound/testcode/unitverify.c
499
alloc_init(&alloc, NULL, 1);
usr.sbin/unbound/testcode/unitverify.c
504
nsec3_hash_test_entry(e, &ct, &alloc, region, buf);
usr.sbin/unbound/testcode/unitverify.c
509
alloc_clear(&alloc);
usr.sbin/unbound/testcode/unitverify.c
90
entry_to_repinfo(struct entry* e, struct alloc_cache* alloc,
usr.sbin/unbound/util/alloc.c
103
alloc_init(struct alloc_cache* alloc, struct alloc_cache* super,
usr.sbin/unbound/util/alloc.c
106
memset(alloc, 0, sizeof(*alloc));
usr.sbin/unbound/util/alloc.c
107
alloc->super = super;
usr.sbin/unbound/util/alloc.c
108
alloc->thread_num = thread_num;
usr.sbin/unbound/util/alloc.c
109
alloc->next_id = (uint64_t)thread_num; /* in steps, so that type */
usr.sbin/unbound/util/alloc.c
110
alloc->next_id <<= THRNUM_SHIFT; /* of *_id is used. */
usr.sbin/unbound/util/alloc.c
111
alloc->last_id = 1; /* so no 64bit constants, */
usr.sbin/unbound/util/alloc.c
112
alloc->last_id <<= THRNUM_SHIFT; /* or implicit 'int' ops. */
usr.sbin/unbound/util/alloc.c
113
alloc->last_id -= 1; /* for compiler portability. */
usr.sbin/unbound/util/alloc.c
114
alloc->last_id |= alloc->next_id;
usr.sbin/unbound/util/alloc.c
115
alloc->next_id += 1; /* because id=0 is special. */
usr.sbin/unbound/util/alloc.c
116
alloc->max_reg_blocks = 100;
usr.sbin/unbound/util/alloc.c
117
alloc->num_reg_blocks = 0;
usr.sbin/unbound/util/alloc.c
118
alloc->reg_list = NULL;
usr.sbin/unbound/util/alloc.c
119
alloc->cleanup = NULL;
usr.sbin/unbound/util/alloc.c
120
alloc->cleanup_arg = NULL;
usr.sbin/unbound/util/alloc.c
121
if(alloc->super)
usr.sbin/unbound/util/alloc.c
122
prealloc_blocks(alloc, alloc->max_reg_blocks);
usr.sbin/unbound/util/alloc.c
123
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
124
lock_quick_init(&alloc->lock);
usr.sbin/unbound/util/alloc.c
125
lock_protect(&alloc->lock, alloc, sizeof(*alloc));
usr.sbin/unbound/util/alloc.c
131
alloc_clear_special_list(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
135
p = alloc->quar;
usr.sbin/unbound/util/alloc.c
146
alloc_clear_special(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
148
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
149
lock_quick_lock(&alloc->lock);
usr.sbin/unbound/util/alloc.c
151
alloc_clear_special_list(alloc);
usr.sbin/unbound/util/alloc.c
152
alloc->quar = 0;
usr.sbin/unbound/util/alloc.c
153
alloc->num_quar = 0;
usr.sbin/unbound/util/alloc.c
154
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
155
lock_quick_unlock(&alloc->lock);
usr.sbin/unbound/util/alloc.c
160
alloc_clear(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
164
if(!alloc)
usr.sbin/unbound/util/alloc.c
166
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
167
lock_quick_destroy(&alloc->lock);
usr.sbin/unbound/util/alloc.c
169
if(alloc->super && alloc->quar) {
usr.sbin/unbound/util/alloc.c
171
p = alloc->quar;
usr.sbin/unbound/util/alloc.c
174
lock_quick_lock(&alloc->super->lock);
usr.sbin/unbound/util/alloc.c
175
alloc_set_special_next(p, alloc->super->quar);
usr.sbin/unbound/util/alloc.c
176
alloc->super->quar = alloc->quar;
usr.sbin/unbound/util/alloc.c
177
alloc->super->num_quar += alloc->num_quar;
usr.sbin/unbound/util/alloc.c
178
lock_quick_unlock(&alloc->super->lock);
usr.sbin/unbound/util/alloc.c
180
alloc_clear_special_list(alloc);
usr.sbin/unbound/util/alloc.c
182
alloc->quar = 0;
usr.sbin/unbound/util/alloc.c
183
alloc->num_quar = 0;
usr.sbin/unbound/util/alloc.c
184
r = alloc->reg_list;
usr.sbin/unbound/util/alloc.c
190
alloc->reg_list = NULL;
usr.sbin/unbound/util/alloc.c
191
alloc->num_reg_blocks = 0;
usr.sbin/unbound/util/alloc.c
195
alloc_get_id(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
197
uint64_t id = alloc->next_id++;
usr.sbin/unbound/util/alloc.c
198
if(id == alloc->last_id) {
usr.sbin/unbound/util/alloc.c
200
fptr_ok(fptr_whitelist_alloc_cleanup(alloc->cleanup));
usr.sbin/unbound/util/alloc.c
201
(*alloc->cleanup)(alloc->cleanup_arg);
usr.sbin/unbound/util/alloc.c
204
alloc->next_id = (uint64_t)alloc->thread_num;
usr.sbin/unbound/util/alloc.c
205
alloc->next_id <<= THRNUM_SHIFT; /* in steps for comp. */
usr.sbin/unbound/util/alloc.c
206
alloc->next_id += 1; /* portability. */
usr.sbin/unbound/util/alloc.c
208
id = alloc->next_id++;
usr.sbin/unbound/util/alloc.c
214
alloc_special_obtain(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
217
log_assert(alloc);
usr.sbin/unbound/util/alloc.c
219
if(alloc->quar) {
usr.sbin/unbound/util/alloc.c
220
p = alloc->quar;
usr.sbin/unbound/util/alloc.c
221
alloc->quar = alloc_special_next(p);
usr.sbin/unbound/util/alloc.c
222
alloc->num_quar--;
usr.sbin/unbound/util/alloc.c
223
p->id = alloc_get_id(alloc);
usr.sbin/unbound/util/alloc.c
227
if(alloc->super) {
usr.sbin/unbound/util/alloc.c
230
lock_quick_lock(&alloc->super->lock);
usr.sbin/unbound/util/alloc.c
231
if((p = alloc->super->quar)) {
usr.sbin/unbound/util/alloc.c
232
alloc->super->quar = alloc_special_next(p);
usr.sbin/unbound/util/alloc.c
233
alloc->super->num_quar--;
usr.sbin/unbound/util/alloc.c
235
lock_quick_unlock(&alloc->super->lock);
usr.sbin/unbound/util/alloc.c
237
p->id = alloc_get_id(alloc);
usr.sbin/unbound/util/alloc.c
242
prealloc_setup(alloc);
usr.sbin/unbound/util/alloc.c
248
p->id = alloc_get_id(alloc);
usr.sbin/unbound/util/alloc.c
254
pushintosuper(struct alloc_cache* alloc, alloc_special_type* mem)
usr.sbin/unbound/util/alloc.c
257
alloc_special_type *p = alloc->quar;
usr.sbin/unbound/util/alloc.c
259
log_assert(alloc && alloc->super &&
usr.sbin/unbound/util/alloc.c
260
alloc->num_quar >= ALLOC_SPECIAL_MAX);
usr.sbin/unbound/util/alloc.c
262
alloc_set_special_next(mem, alloc->quar);
usr.sbin/unbound/util/alloc.c
266
alloc->quar = alloc_special_next(p);
usr.sbin/unbound/util/alloc.c
267
alloc->num_quar -= ALLOC_SPECIAL_MAX/2;
usr.sbin/unbound/util/alloc.c
270
lock_quick_lock(&alloc->super->lock);
usr.sbin/unbound/util/alloc.c
271
alloc_set_special_next(p, alloc->super->quar);
usr.sbin/unbound/util/alloc.c
272
alloc->super->quar = mem;
usr.sbin/unbound/util/alloc.c
273
alloc->super->num_quar += ALLOC_SPECIAL_MAX/2 + 1;
usr.sbin/unbound/util/alloc.c
274
lock_quick_unlock(&alloc->super->lock);
usr.sbin/unbound/util/alloc.c
279
alloc_special_release(struct alloc_cache* alloc, alloc_special_type* mem)
usr.sbin/unbound/util/alloc.c
281
log_assert(alloc);
usr.sbin/unbound/util/alloc.c
284
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
285
lock_quick_lock(&alloc->lock); /* superalloc needs locking */
usr.sbin/unbound/util/alloc.c
289
if(alloc->super && alloc->num_quar >= ALLOC_SPECIAL_MAX) {
usr.sbin/unbound/util/alloc.c
291
pushintosuper(alloc, mem);
usr.sbin/unbound/util/alloc.c
295
alloc_set_special_next(mem, alloc->quar);
usr.sbin/unbound/util/alloc.c
296
alloc->quar = mem;
usr.sbin/unbound/util/alloc.c
297
alloc->num_quar++;
usr.sbin/unbound/util/alloc.c
298
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
299
lock_quick_unlock(&alloc->lock);
usr.sbin/unbound/util/alloc.c
304
alloc_stats(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
306
log_info("%salloc: %d in cache, %d blocks.", alloc->super?"":"sup",
usr.sbin/unbound/util/alloc.c
307
(int)alloc->num_quar, (int)alloc->num_reg_blocks);
usr.sbin/unbound/util/alloc.c
310
size_t alloc_get_mem(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
313
size_t s = sizeof(*alloc);
usr.sbin/unbound/util/alloc.c
314
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
315
lock_quick_lock(&alloc->lock); /* superalloc needs locking */
usr.sbin/unbound/util/alloc.c
317
s += sizeof(alloc_special_type) * alloc->num_quar;
usr.sbin/unbound/util/alloc.c
318
for(p = alloc->quar; p; p = alloc_special_next(p)) {
usr.sbin/unbound/util/alloc.c
321
s += alloc->num_reg_blocks * ALLOC_REG_SIZE;
usr.sbin/unbound/util/alloc.c
322
if(!alloc->super) {
usr.sbin/unbound/util/alloc.c
323
lock_quick_unlock(&alloc->lock);
usr.sbin/unbound/util/alloc.c
329
alloc_reg_obtain(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
331
if(alloc->num_reg_blocks > 0) {
usr.sbin/unbound/util/alloc.c
332
struct regional* r = alloc->reg_list;
usr.sbin/unbound/util/alloc.c
333
alloc->reg_list = (struct regional*)r->next;
usr.sbin/unbound/util/alloc.c
335
alloc->num_reg_blocks--;
usr.sbin/unbound/util/alloc.c
342
alloc_reg_release(struct alloc_cache* alloc, struct regional* r)
usr.sbin/unbound/util/alloc.c
344
if(alloc->num_reg_blocks >= alloc->max_reg_blocks) {
usr.sbin/unbound/util/alloc.c
351
r->next = (char*)alloc->reg_list;
usr.sbin/unbound/util/alloc.c
352
alloc->reg_list = r;
usr.sbin/unbound/util/alloc.c
353
alloc->num_reg_blocks++;
usr.sbin/unbound/util/alloc.c
357
alloc_set_id_cleanup(struct alloc_cache* alloc, void (*cleanup)(void*),
usr.sbin/unbound/util/alloc.c
360
alloc->cleanup = cleanup;
usr.sbin/unbound/util/alloc.c
361
alloc->cleanup_arg = arg;
usr.sbin/unbound/util/alloc.c
67
prealloc_setup(struct alloc_cache* alloc)
usr.sbin/unbound/util/alloc.c
78
alloc_set_special_next(p, alloc->quar);
usr.sbin/unbound/util/alloc.c
79
alloc->quar = p;
usr.sbin/unbound/util/alloc.c
80
alloc->num_quar++;
usr.sbin/unbound/util/alloc.c
86
prealloc_blocks(struct alloc_cache* alloc, size_t num)
usr.sbin/unbound/util/alloc.c
96
r->next = (char*)alloc->reg_list;
usr.sbin/unbound/util/alloc.c
97
alloc->reg_list = r;
usr.sbin/unbound/util/alloc.c
98
alloc->num_reg_blocks ++;
usr.sbin/unbound/util/alloc.h
107
void alloc_init(struct alloc_cache* alloc, struct alloc_cache* super,
usr.sbin/unbound/util/alloc.h
116
void alloc_clear(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
124
void alloc_clear_special(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
132
alloc_special_type* alloc_special_obtain(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
140
void alloc_special_release(struct alloc_cache* alloc, alloc_special_type* mem);
usr.sbin/unbound/util/alloc.h
148
uint64_t alloc_get_id(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
155
size_t alloc_get_mem(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
161
void alloc_stats(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
168
struct regional* alloc_reg_obtain(struct alloc_cache* alloc);
usr.sbin/unbound/util/alloc.h
175
void alloc_reg_release(struct alloc_cache* alloc, struct regional* r);
usr.sbin/unbound/util/alloc.h
184
void alloc_set_id_cleanup(struct alloc_cache* alloc, void (*cleanup)(void*),
usr.sbin/unbound/util/data/msgreply.c
155
reply_info_alloc_rrset_keys(struct reply_info* rep, struct alloc_cache* alloc,
usr.sbin/unbound/util/data/msgreply.c
170
else rep->rrsets[i] = alloc_special_obtain(alloc);
usr.sbin/unbound/util/data/msgreply.c
527
struct alloc_cache* alloc, struct query_info* qinf,
usr.sbin/unbound/util/data/msgreply.c
535
if(!reply_info_alloc_rrset_keys(*rep, alloc, region)) {
usr.sbin/unbound/util/data/msgreply.c
536
if(!region) reply_info_parsedelete(*rep, alloc);
usr.sbin/unbound/util/data/msgreply.c
540
if(!region) reply_info_parsedelete(*rep, alloc);
usr.sbin/unbound/util/data/msgreply.c
546
int reply_info_parse(sldns_buffer* pkt, struct alloc_cache* alloc,
usr.sbin/unbound/util/data/msgreply.c
571
if(!parse_create_msg(pkt, msg, alloc, qinf, rep, NULL)) {
usr.sbin/unbound/util/data/msgreply.c
621
reply_info_parsedelete(struct reply_info* rep, struct alloc_cache* alloc)
usr.sbin/unbound/util/data/msgreply.c
628
ub_packed_rrset_parsedelete(rep->rrsets[i], alloc);
usr.sbin/unbound/util/data/msgreply.c
796
reply_info_copy(struct reply_info* rep, struct alloc_cache* alloc,
usr.sbin/unbound/util/data/msgreply.c
819
reply_info_parsedelete(cp, alloc);
usr.sbin/unbound/util/data/msgreply.c
827
if(!reply_info_alloc_rrset_keys(cp, alloc, region)) {
usr.sbin/unbound/util/data/msgreply.c
829
reply_info_parsedelete(cp, alloc);
usr.sbin/unbound/util/data/msgreply.c
834
reply_info_parsedelete(cp, alloc);
usr.sbin/unbound/util/data/msgreply.h
302
int reply_info_parse(struct sldns_buffer* pkt, struct alloc_cache* alloc,
usr.sbin/unbound/util/data/msgreply.h
322
struct alloc_cache* alloc, struct query_info* qinf,
usr.sbin/unbound/util/data/msgreply.h
349
void reply_info_parsedelete(struct reply_info* rep, struct alloc_cache* alloc);
usr.sbin/unbound/util/data/msgreply.h
398
struct alloc_cache* alloc, struct regional* region);
usr.sbin/unbound/util/data/msgreply.h
413
struct alloc_cache* alloc, struct regional* region);
usr.sbin/unbound/util/data/packed_rrset.c
376
struct alloc_cache* alloc, time_t now)
usr.sbin/unbound/util/data/packed_rrset.c
379
struct ub_packed_rrset_key* dk = alloc_special_obtain(alloc);
usr.sbin/unbound/util/data/packed_rrset.c
386
alloc_special_release(alloc, dk);
usr.sbin/unbound/util/data/packed_rrset.c
392
alloc_special_release(alloc, dk);
usr.sbin/unbound/util/data/packed_rrset.c
57
struct alloc_cache* alloc)
usr.sbin/unbound/util/data/packed_rrset.c
66
alloc_special_release(alloc, pkey);
usr.sbin/unbound/util/data/packed_rrset.h
304
struct alloc_cache* alloc);
usr.sbin/unbound/util/data/packed_rrset.h
460
struct ub_packed_rrset_key* key, struct alloc_cache* alloc,
usr.sbin/unbound/util/module.h
495
struct alloc_cache* alloc;
usr.sbin/unbound/validator/validator.c
1038
env->alloc, *env->now);