summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2006-06-04 16:42:00 +0000
committerAkira TAGOH <akira@tagoh.org>2006-06-04 16:42:00 +0000
commit69590a6a52d2c09cc17048dbac212c0d4399a3ec (patch)
treece208909514415729c6c8c51da6c197ec8d166fb /tests
parent58c209a709b4f4eb9ea7ec2484e16b9719289790 (diff)
2006-06-05 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_init_stack_start): new function. (hg_mem_pool_add_heap): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize): use hg_mem_pool_add_heap instead of direct access. (_hg_allocator_bfit_real_resize_pool): likewise. * hieroglyph/hgmacros.h (HG_STACK_INIT): new macro. (HG_MEM_INIT): new macro. * src/visualizer.c (_heap2offset_new): new function. (_heap2offset_free): new function. (hg_memory_visualizer_set_max_size): store the max size for each pools. (hg_memory_visualizer_get_max_size): similar change. (hg_memory_visualizer_set_heap_state): new function. (hg_memory_visualizer_set_chunk_state): implemented. * src/hgspy.c (_hgspy_vm_thread): call HG_MEM_INIT here. * src/hgspy_helper.c (hg_mem_pool_add_heap): new function.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am10
-rw-r--r--tests/hgallocator-bfit-bench1.c3
-rw-r--r--tests/hgallocator-bfit-bench2.c3
-rw-r--r--tests/hgarray.c3
-rw-r--r--tests/hgdict.c3
-rw-r--r--tests/hgfile.c3
-rw-r--r--tests/hgmem.c2
-rw-r--r--tests/hgstring.c3
-rw-r--r--tests/scanner.c2
-rw-r--r--tests/snapshot.c4
-rw-r--r--tests/vm.c2
11 files changed, 19 insertions, 19 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2f35934..9442e72 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -97,16 +97,6 @@ test_operatorencoding_LDADD = \
$(top_builddir)/libretto/libretto.la \
$(NULL)
-bench1_hgallocator_ffit_SOURCES = \
- hgallocator-ffit-bench1.c \
- $(NULL)
-bench1_hgallocator_ffit_LDADD = $(LDADDS)
-
-bench2_hgallocator_ffit_SOURCES = \
- hgallocator-ffit-bench2.c \
- $(NULL)
-bench2_hgallocator_ffit_LDADD = $(LDADDS)
-
bench1_hgallocator_bfit_SOURCES = \
hgallocator-bfit-bench1.c \
$(NULL)
diff --git a/tests/hgallocator-bfit-bench1.c b/tests/hgallocator-bfit-bench1.c
index 8f9ac0d..fa9506c 100644
--- a/tests/hgallocator-bfit-bench1.c
+++ b/tests/hgallocator-bfit-bench1.c
@@ -6,12 +6,13 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
gint i;
gchar *s;
- hg_mem_init();
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
pool = hg_mem_pool_new(allocator, "test", 90000000, FALSE);
if (pool == NULL) {
diff --git a/tests/hgallocator-bfit-bench2.c b/tests/hgallocator-bfit-bench2.c
index 088788f..f600931 100644
--- a/tests/hgallocator-bfit-bench2.c
+++ b/tests/hgallocator-bfit-bench2.c
@@ -6,12 +6,13 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
gint i;
gchar *s;
- hg_mem_init();
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
pool = hg_mem_pool_new(allocator, "test", 90000000, FALSE);
if (pool == NULL) {
diff --git a/tests/hgarray.c b/tests/hgarray.c
index 74d1960..d6634a8 100644
--- a/tests/hgarray.c
+++ b/tests/hgarray.c
@@ -6,13 +6,14 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
HgArray *a, *b;
HgValueNode *node;
guint i;
- hg_mem_init();
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
pool = hg_mem_pool_new(allocator, "test", 128, TRUE);
if (pool == NULL) {
diff --git a/tests/hgdict.c b/tests/hgdict.c
index a96ea6f..8d42bdd 100644
--- a/tests/hgdict.c
+++ b/tests/hgdict.c
@@ -6,12 +6,13 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
HgDict *d;
HgValueNode *key, *val, *node;
- hg_mem_init();
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
pool = hg_mem_pool_new(allocator, "test", 384, FALSE);
if (pool == NULL) {
diff --git a/tests/hgfile.c b/tests/hgfile.c
index e16cd0d..6845ed2 100644
--- a/tests/hgfile.c
+++ b/tests/hgfile.c
@@ -5,12 +5,13 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
HgFileObject *file;
gchar c;
- hg_mem_init();
hg_file_init();
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
diff --git a/tests/hgmem.c b/tests/hgmem.c
index b8fe094..0df3bd4 100644
--- a/tests/hgmem.c
+++ b/tests/hgmem.c
@@ -91,7 +91,7 @@ test_bfit(void)
int
main(void)
{
- hg_mem_init();
+ HG_MEM_INIT;
#if 0
if (test_ffit() != 0)
diff --git a/tests/hgstring.c b/tests/hgstring.c
index ddea1a7..eb32798 100644
--- a/tests/hgstring.c
+++ b/tests/hgstring.c
@@ -5,11 +5,12 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
HgString *s;
- hg_mem_init();
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
pool = hg_mem_pool_new(allocator, "test", 256, TRUE);
if (pool == NULL) {
diff --git a/tests/scanner.c b/tests/scanner.c
index d3f0dd3..a209a7d 100644
--- a/tests/scanner.c
+++ b/tests/scanner.c
@@ -50,6 +50,8 @@ print_stack(LibrettoStack *stack)
int
main(void)
{
+ HG_MEM_INIT;
+
LibrettoVM *vm;
LibrettoStack *ostack, *estack;
// gchar *tokens = "true false moveto /foo 10050 10a 10.5 -1 .5 -1e10 10.0E5 1E 5.2e-2 36#Z 1#0 %foobar\nfoo(test)((test test) test)(foo\nbar)";
diff --git a/tests/snapshot.c b/tests/snapshot.c
index 97f6780..9bf6c7a 100644
--- a/tests/snapshot.c
+++ b/tests/snapshot.c
@@ -9,6 +9,8 @@
int
main(void)
{
+ HG_MEM_INIT;
+
HgAllocator *allocator;
HgMemPool *pool;
HgMemSnapshot *snap;
@@ -17,8 +19,6 @@ main(void)
HgString *string;
HgDict *dict;
- hg_mem_init();
-
allocator = hg_allocator_new(hg_allocator_bfit_get_vtable());
pool = hg_mem_pool_new(allocator, "test", 256, TRUE);
if (pool == NULL) {
diff --git a/tests/vm.c b/tests/vm.c
index 7c1b234..1697441 100644
--- a/tests/vm.c
+++ b/tests/vm.c
@@ -6,6 +6,8 @@
int
main(void)
{
+ HG_MEM_INIT;
+
LibrettoVM *vm;
LibrettoStack *e, *o;
HgValueNode *node;