Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r1967:ae2c337fc0ae
Date: 2015-11-05 17:38 +0100
http://bitbucket.org/pypy/stmgc/changeset/ae2c337fc0ae/

Log:    tweaks

diff --git a/c8/stm/hashtable.c b/c8/stm/hashtable.c
--- a/c8/stm/hashtable.c
+++ b/c8/stm/hashtable.c
@@ -53,7 +53,7 @@
 #define TRACE_FLAG_ONCE             1
 #define TRACE_FLAG_KEEPALIVE        2
 
-typedef struct stm_hashtable_table_s {
+struct stm_hashtable_table_s {
     uintptr_t mask;      /* 'mask' is always immutable. */
 
     /* 'resize_counter' start at an odd value, and is decremented (by
@@ -70,7 +70,7 @@
     uint8_t trace_flag;
 
     stm_hashtable_entry_t *items[INITIAL_HASHTABLE_SIZE];
-} stm_hashtable_table_t;
+};
 
 #define IS_EVEN(p) (((p) & 1) == 0)
 
@@ -617,7 +617,7 @@
 }
 
 stm_hashtable_entry_t **
-stm_hashtable_iter_next(object_t *hobj, struct stm_hashtable_table_s *table,
+stm_hashtable_iter_next(object_t *hobj, stm_hashtable_table_t *table,
                         stm_hashtable_entry_t **previous)
 {
     /* Set the read marker on hobj for every item, in case we have
@@ -654,7 +654,7 @@
     return NULL;
 }
 
-void stm_hashtable_iter_tracefn(struct stm_hashtable_table_s *table,
+void stm_hashtable_iter_tracefn(stm_hashtable_table_t *table,
                                 void trace(object_t **))
 {
     if (all_hashtables_seen == NULL) {   /* for minor collections */
diff --git a/c8/stmgc.h b/c8/stmgc.h
--- a/c8/stmgc.h
+++ b/c8/stmgc.h
@@ -774,11 +774,12 @@
    RuntimeError).  When the GC traces, you must keep the table pointer
    alive with stm_hashtable_iter_tracefn().  The original hashtable
    object must also be kept alive. */
-struct stm_hashtable_table_s *stm_hashtable_iter(stm_hashtable_t *);
+typedef struct stm_hashtable_table_s stm_hashtable_table_t;
+stm_hashtable_table_t *stm_hashtable_iter(stm_hashtable_t *);
 stm_hashtable_entry_t **
-stm_hashtable_iter_next(object_t *hobj, struct stm_hashtable_table_s *table,
+stm_hashtable_iter_next(object_t *hobj, stm_hashtable_table_t *table,
                         stm_hashtable_entry_t **previous);
-void stm_hashtable_iter_tracefn(struct stm_hashtable_table_s *table,
+void stm_hashtable_iter_tracefn(stm_hashtable_table_t *table,
                                 void trace(object_t **));
 
 
diff --git a/c8/test/test_hashtable.py b/c8/test/test_hashtable.py
--- a/c8/test/test_hashtable.py
+++ b/c8/test/test_hashtable.py
@@ -542,7 +542,7 @@
         maximum.add('DONE')
         for iterobj, i, seen in iterators:
             assert seen.issubset(maximum)
-            for j in range(i):
+            for j in range(i + 1):
                 assert j ^ 19 in seen
             # we may also have seen more items added later
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to