[pypy-commit] pypy stm-thread-2: Minor type fixes.
arigo
noreply at buildbot.pypy.org
Fri Sep 14 11:09:36 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: stm-thread-2
Changeset: r57336:80594b3d0263
Date: 2012-09-14 11:02 +0200
http://bitbucket.org/pypy/pypy/changeset/80594b3d0263/
Log: Minor type fixes.
diff --git a/pypy/rpython/memory/gc/stmgc.py b/pypy/rpython/memory/gc/stmgc.py
--- a/pypy/rpython/memory/gc/stmgc.py
+++ b/pypy/rpython/memory/gc/stmgc.py
@@ -338,7 +338,7 @@
# id() and identityhash() support
def id(self, gcobj):
- """NOT IMPLEMENTED! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"""
+ debug_print("XXX: id() not implemented")
return self.identityhash(gcobj)
def identityhash(self, gcobj):
diff --git a/pypy/translator/stm/src_stm/et.c b/pypy/translator/stm/src_stm/et.c
--- a/pypy/translator/stm/src_stm/et.c
+++ b/pypy/translator/stm/src_stm/et.c
@@ -183,21 +183,22 @@
return R;
}
-gcptr stm_DirectReadBarrier(gcptr G)
+void *stm_DirectReadBarrier(void *G1)
{
- return _direct_read_barrier(G, NULL, 0);
+ return _direct_read_barrier((gcptr)G1, NULL, 0);
}
-gcptr stm_DirectReadBarrierFromR(gcptr G, gcptr R_Container, size_t offset)
+void *stm_DirectReadBarrierFromR(void *G1, void *R_Container1, size_t offset)
{
- return _direct_read_barrier(G, R_Container, offset);
+ return _direct_read_barrier((gcptr)G1, (gcptr)R_Container1, offset);
}
-gcptr stm_RepeatReadBarrier(gcptr O)
+void *stm_RepeatReadBarrier(void *O1)
{
// LatestGlobalRevision(O) would either return O or abort
// the whole transaction, so omitting it is not wrong
struct tx_descriptor *d = thread_descriptor;
+ gcptr O = (gcptr)O1;
gcptr L;
wlog_t *entry;
G2L_FIND(d->global_to_local, O, entry, return O);
@@ -248,8 +249,9 @@
return L;
}
-gcptr stm_WriteBarrier(gcptr P)
+void *stm_WriteBarrier(void *P1)
{
+ gcptr P = (gcptr)P1;
gcptr R, W;
if (!(P->h_tid & GCFLAG_GLOBAL))
{
@@ -271,8 +273,9 @@
return W;
}
-gcptr stm_WriteBarrierFromReady(gcptr R)
+void *stm_WriteBarrierFromReady(void *R1)
{
+ gcptr R = (gcptr)R1;
gcptr W;
if (!(R->h_tid & GCFLAG_GLOBAL))
{
diff --git a/pypy/translator/stm/src_stm/et.h b/pypy/translator/stm/src_stm/et.h
--- a/pypy/translator/stm/src_stm/et.h
+++ b/pypy/translator/stm/src_stm/et.h
@@ -42,34 +42,34 @@
#define STM_BARRIER_P2R(P) \
(__builtin_expect((((gcptr)(P))->h_tid & GCFLAG_GLOBAL) == 0, 1) ? \
- (P) : (typeof(P))stm_DirectReadBarrier((gcptr)(P)))
+ (P) : (typeof(P))stm_DirectReadBarrier(P))
#define STM_BARRIER_G2R(G) \
(assert(((gcptr)(G))->h_tid & GCFLAG_GLOBAL), \
- (typeof(G))stm_DirectReadBarrier((gcptr)(G)))
+ (typeof(G))stm_DirectReadBarrier(G))
#define STM_BARRIER_O2R(O) \
(__builtin_expect((((gcptr)(O))->h_tid & GCFLAG_POSSIBLY_OUTDATED) == 0, \
1) ? \
- (O) : (typeof(O))stm_RepeatReadBarrier((gcptr)(O)))
+ (O) : (typeof(O))stm_RepeatReadBarrier(O))
/*#define STM_READ_BARRIER_P_FROM_R(P, R_container, offset) \
(__builtin_expect((((gcptr)(P))->h_tid & GCFLAG_GLOBAL) == 0, 1) ? \
- (P) : (typeof(P))stm_DirectReadBarrierFromR((gcptr)(P), \
- (gcptr)(R_container), \
+ (P) : (typeof(P))stm_DirectReadBarrierFromR((P), \
+ (R_container), \
offset))*/
#define STM_BARRIER_P2W(P) \
(__builtin_expect((((gcptr)(P))->h_tid & GCFLAG_NOT_WRITTEN) == 0, 1) ? \
- (P) : (typeof(P))stm_WriteBarrier((gcptr)(P)))
+ (P) : (typeof(P))stm_WriteBarrier(P))
#define STM_BARRIER_G2W(G) \
(assert(((gcptr)(G))->h_tid & GCFLAG_GLOBAL), \
- (typeof(G))stm_WriteBarrier((gcptr)(G)))
+ (typeof(G))stm_WriteBarrier(G))
#define STM_BARRIER_R2W(R) \
(__builtin_expect((((gcptr)(R))->h_tid & GCFLAG_NOT_WRITTEN) == 0, 1) ? \
- (R) : (typeof(R))stm_WriteBarrierFromReady((gcptr)(R)))
+ (R) : (typeof(R))stm_WriteBarrierFromReady(R))
#define STM_BARRIER_O2W(R) STM_BARRIER_R2W(R) /* same logic works here */
@@ -90,11 +90,11 @@
_Bool stm_PtrEq(gcptr P1, gcptr P2);
gcptr stm_HashObject(gcptr P);
-gcptr stm_DirectReadBarrier(gcptr);
-gcptr stm_DirectReadBarrierFromR(gcptr, gcptr, size_t);
-gcptr stm_RepeatReadBarrier(gcptr);
-gcptr stm_WriteBarrier(gcptr);
-gcptr stm_WriteBarrierFromReady(gcptr);
+void *stm_DirectReadBarrier(void *);
+void *stm_DirectReadBarrierFromR(void *, void *, size_t);
+void *stm_RepeatReadBarrier(void *);
+void *stm_WriteBarrier(void *);
+void *stm_WriteBarrierFromReady(void *);
//gcptr _NonTransactionalReadBarrier(gcptr);
More information about the pypy-commit
mailing list