* double of the original one.
* This is typically called when we find that current buffer is too small
* to save all the data.
+ *
+ * IN:
+ * @a Activity structure.
+ *
+ * RETURNS:
+ * New pointer address on buffer.
***************************************************************************
*/
-void reallocate_buffer(struct activity *a)
+void *reallocate_buffer(struct activity *a)
{
SREALLOC(a->_buf0, void,
(size_t) a->msize * (size_t) a->nr_allocated * 2); /* a->nr2 value is 1 */
memset(a->_buf0, 0, (size_t) a->msize * (size_t) a->nr_allocated * 2);
a->nr_allocated *= 2; /* NB: nr_allocated > 0 */
+
+ return a->_buf0;
}
/*
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_cpu = (struct stats_cpu *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_irq = (struct stats_irq *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_disk = (struct stats_disk *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_serial = (struct stats_serial *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_net_dev = (struct stats_net_dev *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_net_edev = (struct stats_net_edev *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_pwr_cpufreq = (struct stats_pwr_cpufreq *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_pwr_fan = (struct stats_pwr_fan *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_pwr_temp = (struct stats_pwr_temp *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_pwr_in = (struct stats_pwr_in *) reallocate_buffer(a);
}
}
while (nr_read < 0);
/* NB: nr_allocated > 0 */
a->nr_allocated *= 2;
+ st_pwr_wghfreq = (struct stats_pwr_wghfreq *) a->_buf0;
}
}
while(nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_pwr_usb = (struct stats_pwr_usb *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_filesystem = (struct stats_filesystem *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_fc = (struct stats_fchost *) reallocate_buffer(a);
}
}
while (nr_read < 0);
if (nr_read < 0) {
/* Buffer needs to be reallocated */
- reallocate_buffer(a);
+ st_softnet = (struct stats_softnet *) reallocate_buffer(a);
}
}
while (nr_read < 0);