Exclude internal commands formats & segtypes from install.
Version 2.00.24 -
=====================================
+ Some fixes to memory debugging code.
+ Exclude internal commands formats & segtypes from install.
Version 2.00.23 - 15th September 2004
=====================================
};
static struct {
- unsigned int blocks, mblocks;
+ unsigned block_serialno;/* Non-decreasing serialno of block */
+ unsigned blocks_allocated; /* Current number of blocks allocated */
+ unsigned blocks_max; /* Max no of concurrently-allocated blocks */
unsigned int bytes, mbytes;
} _mem_stats = {
-0, 0, 0, 0};
+0, 0, 0, 0, 0};
static struct memblock *_head = 0;
static struct memblock *_tail = 0;
/* setup fields */
nb->magic = nb + 1;
nb->length = s;
- nb->id = ++_mem_stats.blocks;
+ nb->id = ++_mem_stats.block_serialno;
nb->next = 0;
nb->prev = _tail;
*ptr++ = (char) nb->id;
}
- if (_mem_stats.blocks > _mem_stats.mblocks)
- _mem_stats.mblocks = _mem_stats.blocks;
+ _mem_stats.blocks_allocated++;
+ if (_mem_stats.blocks_allocated > _mem_stats.blocks_max)
+ _mem_stats.blocks_max = _mem_stats.blocks_allocated;
_mem_stats.bytes += s;
if (_mem_stats.bytes > _mem_stats.mbytes)
else
_tail = mb->prev;
- assert(_mem_stats.blocks);
- _mem_stats.blocks--;
+ assert(_mem_stats.blocks_allocated);
+ _mem_stats.blocks_allocated--;
_mem_stats.bytes -= mb->length;
/* free the memory */
static struct block *_new_block(size_t s, unsigned alignment)
{
- static char *_oom = "Out of memory";
+ static const char *_oom = "Out of memory";
/* FIXME: I'm currently ignoring the alignment arg. */
size_t len = sizeof(struct block) + s;
if (p->object) {
memcpy(new->data, p->object->data, p->object->size);
+ dbg_free(p->object->data);
dbg_free(p->object);
}
p->object = new;
+ memcpy(new->data + size - delta, buffer, delta);
+
return 1;
}
.commands: commands.h cmdnames.h Makefile
$(CC) -E -P cmdnames.h 2> /dev/null | \
- egrep -v '^ *(|#.*|dumpconfig|help|pvdata|version) *$$' > .commands
+ egrep -v '^ *(|#.*|dumpconfig|formats|help|pvdata|segtypes|version) *$$' > .commands
.PHONY: install_cmdlib_dynamic install_cmdlib_static \
install_tools_dynamic install_tools_static