Skip to content

Commit

Permalink
Some changes to improve performance of the Julia GC integration.
Browse files Browse the repository at this point in the history
We're using a new function on the Julia side to verify more quickly
that a master pointer is actually valid. Also, some of the marking
logic is now done on the GAP side, which avoids unnecessary expensive
function calls to the Julia API.
  • Loading branch information
rbehrends committed May 22, 2018
1 parent b513ee6 commit df603cb
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/julia_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,22 @@ void SwapMasterPoint(Bag bag1, Bag bag2)
inline void MarkBag(Bag bag)
{
if (IS_BAG_REF(bag)) {
void * p = jl_pool_base_ptr(bag);
if (p == bag) {
if (JMark(p) && OldObj)
YoungRef++;
jl_value_t * p = (jl_value_t *)bag;
if (jl_is_internal_obj_alloc(p) && jl_typeis(p, datatype_mptr)) {
switch (jl_astaggedvalue(p)->bits.gc) {
case 0:
if (JMark(p) && OldObj)
YoungRef++;
break;
case 1:
if (OldObj)
YoungRef++;
break;
case 2:
JMark(p);
case 3:
break;
}
}
}
}
Expand Down

0 comments on commit df603cb

Please sign in to comment.