Symbol: memman
usr.sbin/acpitools/aml/aml_amlmem.c
93
static struct memman _aml_memman = MEMMAN_MEMMANAGER_DESC(aml_blockman, 21,
usr.sbin/acpitools/aml/aml_amlmem.c
96
struct memman *aml_memman = &_aml_memman;
usr.sbin/acpitools/aml/aml_amlmem.h
65
extern struct memman *aml_memman;
usr.sbin/acpitools/aml/aml_memman.c
121
blockman_init(struct memman *memman, unsigned int id)
usr.sbin/acpitools/aml/aml_memman.c
126
bmp = &memman->blockman[id];
usr.sbin/acpitools/aml/aml_memman.c
131
status = manage_block(memman, id, bmp->initial_block,
usr.sbin/acpitools/aml/aml_memman.c
137
memman_alloc(struct memman *memman, unsigned int id)
usr.sbin/acpitools/aml/aml_memman.c
144
if (memman->max_memid <= id) {
usr.sbin/acpitools/aml/aml_memman.c
148
bmp = &memman->blockman[id];
usr.sbin/acpitools/aml/aml_memman.c
150
if (blockman_init(memman, id)) {
usr.sbin/acpitools/aml/aml_memman.c
154
memman->alloc_called++;
usr.sbin/acpitools/aml/aml_memman.c
163
memman->required_mem += bmp->size * MEMMAN_INCR_SIZE;
usr.sbin/acpitools/aml/aml_memman.c
164
memman->allocated_mem += alloc_size;
usr.sbin/acpitools/aml/aml_memman.c
165
memman->salloc_called++;
usr.sbin/acpitools/aml/aml_memman.c
167
if (manage_block(memman, id, block, 0, MEMMAN_INCR_SIZE)) {
usr.sbin/acpitools/aml/aml_memman.c
186
memman_flexsize_add_histogram(struct memman *memman, size_t size,
usr.sbin/acpitools/aml/aml_memman.c
195
for (i = 0; i < memman->flex_mem_histogram_ptr; i++) {
usr.sbin/acpitools/aml/aml_memman.c
196
gap = memman->flex_mem_histogram[i].mem_size - size;
usr.sbin/acpitools/aml/aml_memman.c
198
memman->flex_mem_histogram[i].count++;
usr.sbin/acpitools/aml/aml_memman.c
199
if (memman->flex_mem_histogram[i].mem_size < size) {
usr.sbin/acpitools/aml/aml_memman.c
200
memman->flex_mem_histogram[i].mem_size = size;
usr.sbin/acpitools/aml/aml_memman.c
206
if (memman->flex_mem_histogram_ptr == MEMMAN_HISTOGRAM_SIZE) {
usr.sbin/acpitools/aml/aml_memman.c
207
memman_flexsize_add_histogram(memman, size, tolerance + 1);
usr.sbin/acpitools/aml/aml_memman.c
210
i = memman->flex_mem_histogram_ptr;
usr.sbin/acpitools/aml/aml_memman.c
211
memman->flex_mem_histogram[i].mem_size = size;
usr.sbin/acpitools/aml/aml_memman.c
212
memman->flex_mem_histogram[i].count = 1;
usr.sbin/acpitools/aml/aml_memman.c
213
memman->flex_mem_histogram_ptr++;
usr.sbin/acpitools/aml/aml_memman.c
227
memman_sort_histogram_by_size(struct memman *memman)
usr.sbin/acpitools/aml/aml_memman.c
229
qsort(memman->flex_mem_histogram, memman->flex_mem_histogram_ptr,
usr.sbin/acpitools/aml/aml_memman.c
234
memman_alloc_flexsize(struct memman *memman, size_t size)
usr.sbin/acpitools/aml/aml_memman.c
246
if (!memman->flex_mem_initialized) {
usr.sbin/acpitools/aml/aml_memman.c
247
LIST_INIT(&memman->flexmem_info_list);
usr.sbin/acpitools/aml/aml_memman.c
248
bzero(memman->flex_mem_histogram,
usr.sbin/acpitools/aml/aml_memman.c
250
memman->flex_mem_initialized = 1;
usr.sbin/acpitools/aml/aml_memman.c
254
LIST_INSERT_HEAD(&memman->flexmem_info_list, info, links);
usr.sbin/acpitools/aml/aml_memman.c
256
memman->flex_alloc_called++;
usr.sbin/acpitools/aml/aml_memman.c
257
memman->flex_salloc_called++;
usr.sbin/acpitools/aml/aml_memman.c
258
memman->flex_required_mem += size;
usr.sbin/acpitools/aml/aml_memman.c
259
memman->flex_allocated_mem += size;
usr.sbin/acpitools/aml/aml_memman.c
260
if (memman->flex_mem_size_min == 0 ||
usr.sbin/acpitools/aml/aml_memman.c
261
memman->flex_mem_size_min > size) {
usr.sbin/acpitools/aml/aml_memman.c
262
memman->flex_mem_size_min = size;
usr.sbin/acpitools/aml/aml_memman.c
264
if (memman->flex_mem_size_max < size) {
usr.sbin/acpitools/aml/aml_memman.c
265
memman->flex_mem_size_max = size;
usr.sbin/acpitools/aml/aml_memman.c
267
if (memman->flex_peak_mem_usage <
usr.sbin/acpitools/aml/aml_memman.c
268
(memman->flex_allocated_mem - memman->flex_reclaimed_mem)) {
usr.sbin/acpitools/aml/aml_memman.c
269
memman->flex_peak_mem_usage =
usr.sbin/acpitools/aml/aml_memman.c
270
(memman->flex_allocated_mem - memman->flex_reclaimed_mem);
usr.sbin/acpitools/aml/aml_memman.c
272
memman_flexsize_add_histogram(memman, size,
usr.sbin/acpitools/aml/aml_memman.c
273
memman->flex_mem_histogram_initial_tolerance);
usr.sbin/acpitools/aml/aml_memman.c
279
memman_guess_memid(struct memman *memman, void *chunk)
usr.sbin/acpitools/aml/aml_memman.c
285
for (id = 0; id < memman->max_memid; id++) {
usr.sbin/acpitools/aml/aml_memman.c
286
bmp = &memman->blockman[id];
usr.sbin/acpitools/aml/aml_memman.c
288
if (blockman_init(memman, id)) {
usr.sbin/acpitools/aml/aml_memman.c
302
memman_free(struct memman *memman, unsigned int memid, void *chunk)
usr.sbin/acpitools/aml/aml_memman.c
313
id = memman_guess_memid(memman, chunk);
usr.sbin/acpitools/aml/aml_memman.c
315
if (memman->max_memid <= id) {
usr.sbin/acpitools/aml/aml_memman.c
320
bmp = &memman->blockman[id];
usr.sbin/acpitools/aml/aml_memman.c
322
if (blockman_init(memman, id)) {
usr.sbin/acpitools/aml/aml_memman.c
337
memman->free_called++;
usr.sbin/acpitools/aml/aml_memman.c
356
memman->sfree_called++;
usr.sbin/acpitools/aml/aml_memman.c
359
memman->sfree_called++;
usr.sbin/acpitools/aml/aml_memman.c
360
memman->reclaimed_mem += memblock->allocated_mem;
usr.sbin/acpitools/aml/aml_memman.c
366
memman_free_flexsize(struct memman *memman, void *chunk)
usr.sbin/acpitools/aml/aml_memman.c
370
LIST_FOREACH(info, &memman->flexmem_info_list, links) {
usr.sbin/acpitools/aml/aml_memman.c
372
memman->flex_reclaimed_mem += info->mem_size;
usr.sbin/acpitools/aml/aml_memman.c
379
memman->flex_free_called++;
usr.sbin/acpitools/aml/aml_memman.c
380
memman->flex_sfree_called++;
usr.sbin/acpitools/aml/aml_memman.c
385
memman_freeall(struct memman *memman)
usr.sbin/acpitools/aml/aml_memman.c
394
for (id = 0; id < memman->max_memid; id++) {
usr.sbin/acpitools/aml/aml_memman.c
395
bmp = &memman->blockman[id];
usr.sbin/acpitools/aml/aml_memman.c
400
memman_free(memman, id, chunk);
usr.sbin/acpitools/aml/aml_memman.c
405
memman->sfree_called++;
usr.sbin/acpitools/aml/aml_memman.c
406
memman->reclaimed_mem += memblock->allocated_mem;
usr.sbin/acpitools/aml/aml_memman.c
413
LIST_FOREACH(info, &memman->flexmem_info_list, links) {
usr.sbin/acpitools/aml/aml_memman.c
416
memman_free_flexsize(memman, info->addr);
usr.sbin/acpitools/aml/aml_memman.c
421
memman_statistics_fixedsize(struct memman *memman)
usr.sbin/acpitools/aml/aml_memman.c
424
printf(" alloc(): %d times\n", memman->alloc_called);
usr.sbin/acpitools/aml/aml_memman.c
425
printf(" system malloc(): %d times\n", memman->salloc_called);
usr.sbin/acpitools/aml/aml_memman.c
426
printf(" free(): %d times\n", memman->free_called);
usr.sbin/acpitools/aml/aml_memman.c
427
printf(" system free(): %d times\n", memman->sfree_called);
usr.sbin/acpitools/aml/aml_memman.c
428
printf(" required memory: %zd bytes\n", memman->required_mem);
usr.sbin/acpitools/aml/aml_memman.c
429
printf(" allocated memory: %zd bytes\n", memman->allocated_mem);
usr.sbin/acpitools/aml/aml_memman.c
430
printf(" reclaimed memory: %zd bytes\n", memman->reclaimed_mem);
usr.sbin/acpitools/aml/aml_memman.c
434
memman_statistics_flexsize(struct memman *memman)
usr.sbin/acpitools/aml/aml_memman.c
439
printf(" alloc(): %d times\n", memman->flex_alloc_called);
usr.sbin/acpitools/aml/aml_memman.c
440
printf(" system malloc(): %d times\n", memman->flex_salloc_called);
usr.sbin/acpitools/aml/aml_memman.c
441
printf(" free(): %d times\n", memman->flex_free_called);
usr.sbin/acpitools/aml/aml_memman.c
442
printf(" system free(): %d times\n", memman->flex_sfree_called);
usr.sbin/acpitools/aml/aml_memman.c
443
printf(" required memory: %zd bytes\n", memman->flex_required_mem);
usr.sbin/acpitools/aml/aml_memman.c
444
printf(" allocated memory: %zd bytes\n", memman->flex_allocated_mem);
usr.sbin/acpitools/aml/aml_memman.c
445
printf(" reclaimed memory: %zd bytes\n", memman->flex_reclaimed_mem);
usr.sbin/acpitools/aml/aml_memman.c
446
printf(" peak memory usage: %zd bytes\n", memman->flex_peak_mem_usage);
usr.sbin/acpitools/aml/aml_memman.c
447
printf(" min memory size: %zd bytes\n", memman->flex_mem_size_min);
usr.sbin/acpitools/aml/aml_memman.c
448
printf(" max memory size: %zd bytes\n", memman->flex_mem_size_max);
usr.sbin/acpitools/aml/aml_memman.c
450
(memman->flex_alloc_called) ?
usr.sbin/acpitools/aml/aml_memman.c
451
memman->flex_allocated_mem / memman->flex_alloc_called : 0);
usr.sbin/acpitools/aml/aml_memman.c
454
memman->flex_mem_histogram_ptr);
usr.sbin/acpitools/aml/aml_memman.c
456
memman_sort_histogram_by_size(memman);
usr.sbin/acpitools/aml/aml_memman.c
457
for (i = 0; i < memman->flex_mem_histogram_ptr; i++) {
usr.sbin/acpitools/aml/aml_memman.c
459
memman->flex_mem_histogram[i].mem_size,
usr.sbin/acpitools/aml/aml_memman.c
460
memman->flex_mem_histogram[i].count);
usr.sbin/acpitools/aml/aml_memman.c
465
memman_statistics(struct memman *memman)
usr.sbin/acpitools/aml/aml_memman.c
468
memman_statistics_fixedsize(memman);
usr.sbin/acpitools/aml/aml_memman.c
469
memman_statistics_flexsize(memman);
usr.sbin/acpitools/aml/aml_memman.c
473
memman_memid2size(struct memman *memman, unsigned int id)
usr.sbin/acpitools/aml/aml_memman.c
475
if (memman->max_memid <= id) {
usr.sbin/acpitools/aml/aml_memman.c
479
return (memman->blockman[id].size);
usr.sbin/acpitools/aml/aml_memman.c
55
static int manage_block(struct memman *memman, unsigned int id,
usr.sbin/acpitools/aml/aml_memman.c
58
static int blockman_init(struct memman *memman, unsigned int id);
usr.sbin/acpitools/aml/aml_memman.c
59
static void memman_flexsize_add_histogram(struct memman *memman,
usr.sbin/acpitools/aml/aml_memman.c
64
static void memman_sort_histogram_by_size(struct memman *memman);
usr.sbin/acpitools/aml/aml_memman.c
65
static unsigned int memman_guess_memid(struct memman *memman, void *chunk);
usr.sbin/acpitools/aml/aml_memman.c
66
static void memman_statistics_fixedsize(struct memman *memman);
usr.sbin/acpitools/aml/aml_memman.c
67
static void memman_statistics_flexsize(struct memman *memman);
usr.sbin/acpitools/aml/aml_memman.c
70
manage_block(struct memman *memman, unsigned int id, void *block,
usr.sbin/acpitools/aml/aml_memman.c
80
bmp = &memman->blockman[id];
usr.sbin/acpitools/aml/aml_memman.c
93
memman->allocated_mem += alloc_size;
usr.sbin/acpitools/aml/aml_memman.c
94
memman->salloc_called++;
usr.sbin/acpitools/aml/aml_memman.h
164
void *memman_alloc(struct memman *, unsigned int);
usr.sbin/acpitools/aml/aml_memman.h
165
void *memman_alloc_flexsize(struct memman *, size_t);
usr.sbin/acpitools/aml/aml_memman.h
166
void memman_free(struct memman *, unsigned int, void *);
usr.sbin/acpitools/aml/aml_memman.h
167
void memman_free_flexsize(struct memman *, void *);
usr.sbin/acpitools/aml/aml_memman.h
168
void memman_freeall(struct memman *);
usr.sbin/acpitools/aml/aml_memman.h
169
void memman_statistics(struct memman *);
usr.sbin/acpitools/aml/aml_memman.h
170
size_t memman_memid2size(struct memman *, unsigned int);