struct stacks_anchor {
int depth;
- int header_size;
struct stack_vectors *vectors;
struct stacks_anchor *self;
struct stacks_anchor *next;
++n;
}
fprintf(stderr, "%s: found %d stack(s), each %d bytes (including eos)\n", __func__, x, (int)sizeof(struct meminfo_result) * t);
- fprintf(stderr, "%s: this header size = %2d\n", __func__, (int)p->owner->header_size);
fprintf(stderr, "%s: sizeof(struct meminfo_stack) = %2d\n", __func__, (int)sizeof(struct meminfo_stack));
fprintf(stderr, "%s: sizeof(struct meminfo_result) = %2d\n", __func__, (int)sizeof(struct meminfo_result));
fputc('\n', stderr);
static struct meminfo_stack **procps_meminfo_stacks_alloc (
struct procps_meminfo *info,
int maxstacks,
- int stack_extra,
int maxitems,
enum meminfo_item *items)
{
vect_size = sizeof(struct stack_vectors); // address vector struct
vect_size += sizeof(void *) * maxstacks; // plus vectors themselves
vect_size += sizeof(void *); // plus NULL delimiter
- head_size = sizeof(struct meminfo_stack) + stack_extra; // a head struct + user stuff
+ head_size = sizeof(struct meminfo_stack); // a head struct
list_size = sizeof(struct meminfo_result) * maxitems; // a results stack
blob_size = sizeof(struct stacks_anchor); // the anchor itself
blob_size += vect_size; // all vectors + delims
p_blob->next = info->stacked;
info->stacked = p_blob;
p_blob->self = p_blob;
- p_blob->header_size = head_size;
p_blob->vectors = (void *)p_blob + sizeof(struct stacks_anchor);
p_vect = p_blob->vectors;
p_vect->owner = p_blob->self;
{
struct meminfo_stack **v;
- v = procps_meminfo_stacks_alloc(info, 1, 0, maxitems, items);
+ v = procps_meminfo_stacks_alloc(info, 1, maxitems, items);
if (!v)
return NULL;
stacks_validate(v, __func__);
struct stacks_anchor {
int depth;
int inuse;
- int header_size;
struct stack_vectors *vectors;
struct stacks_anchor *self;
struct stacks_anchor *next;
}
fprintf(stderr, "%s: found %d stack(s), each %d bytes (including eos)\n", __func__, x, (int)sizeof(struct slab_result) * t);
fprintf(stderr, "%s: found %d stack(s)\n", __func__, x);
- fprintf(stderr, "%s: this header size = %2d\n", __func__, (int)p->owner->header_size);
fprintf(stderr, "%s: sizeof(struct slabnode_stack) = %2d\n", __func__, (int)sizeof(struct slabnode_stack));
- fprintf(stderr, "%s: sizeof(struct slab_result) = %2d\n", __func__, (int)sizeof(struct slab_result));
+ fprintf(stderr, "%s: sizeof(struct slab_result) = %2d\n", __func__, (int)sizeof(struct slab_result));
fputc('\n', stderr);
return;
#endif
PROCPS_EXPORT struct slabnode_stack **procps_slabnode_stacks_alloc (
struct procps_slabinfo *info,
int maxstacks,
- int stack_extra,
int maxitems,
enum slabnode_item *items)
{
vect_size = sizeof(struct stack_vectors); // address vector struct
vect_size += sizeof(void *) * maxstacks; // plus vectors themselves
vect_size += sizeof(void *); // plus NULL delimiter
- head_size = sizeof(struct slabnode_stack) + stack_extra; // a head struct + user stuff
+ head_size = sizeof(struct slabnode_stack); // a head struct
list_size = sizeof(struct slab_result) * maxitems; // a results stack
blob_size = sizeof(struct stacks_anchor); // the anchor itself
blob_size += vect_size; // all vectors + delims
p_blob->next = info->stacked;
info->stacked = p_blob;
p_blob->self = p_blob;
- p_blob->header_size = head_size;
p_blob->vectors = (void *)p_blob + sizeof(struct stacks_anchor);
p_vect = p_blob->vectors;
p_vect->owner = p_blob->self;
if (info == NULL || items == NULL || maxitems < 1)
return NULL;
- v = procps_slabnode_stacks_alloc(info, 1, 0, maxitems, items);
+ v = procps_slabnode_stacks_alloc(info, 1, maxitems, items);
if (!v)
return NULL;
stacks_validate(v, __func__);
struct slabnode_stack **procps_slabnode_stacks_alloc (
struct procps_slabinfo *info,
int maxstacks,
- int stack_extra,
int maxitems,
enum slabnode_item *items);
if (procps_slabinfo_new(&Slab_info) < 0)
xerrx(EXIT_FAILURE, _("Unable to create slabinfo structure"));
- if (!(v = procps_slabnode_stacks_alloc(Slab_info, CHAINS_ALLOC, 0, MAX_ITEMS, Node_items)))
+ if (!(v = procps_slabnode_stacks_alloc(Slab_info, CHAINS_ALLOC, MAX_ITEMS, Node_items)))
xerrx(EXIT_FAILURE, _("Unable to allocate slabinfo nodes"));
if (!Run_once) {
if (procps_slabinfo_new(&slab_info) < 0)
xerrx(EXIT_FAILURE, _("Unable to create slabinfo structure"));
- if (!(v = procps_slabnode_stacks_alloc(slab_info, CHAINS_ALLOC, 0, MAX_ITEMS, node_items)))
+ if (!(v = procps_slabnode_stacks_alloc(slab_info, CHAINS_ALLOC, MAX_ITEMS, node_items)))
xerrx(EXIT_FAILURE, _("Unable to allocate slabinfo nodes"));
if (!moreheaders)