@@ -1028,7 +1028,7 @@ static size_t array_nbytes(jl_array_t *a)
1028
1028
return sz ;
1029
1029
}
1030
1030
1031
- void jl_gc_free_array (jl_array_t * a )
1031
+ static void jl_gc_free_array (jl_array_t * a )
1032
1032
{
1033
1033
if (a -> how == 2 ) {
1034
1034
char * d = (char * )a -> data - a -> offset * a -> elsize ;
@@ -1630,19 +1630,21 @@ static void gc_mark_stack(jl_value_t* ta, jl_gcframe_t *s, ptrint_t offset, int
1630
1630
static void gc_mark_task_stack (jl_task_t * ta , int d )
1631
1631
{
1632
1632
int stkbuf = (ta -> stkbuf != (void * )(intptr_t )-1 && ta -> stkbuf != NULL );
1633
+ int16_t tid = ta -> tid ;
1634
+ jl_tls_states_t * ptls = jl_all_task_states [tid ].ptls ;
1633
1635
if (stkbuf ) {
1634
1636
#ifndef COPY_STACKS
1635
- if (ta != jl_root_task ) // stkbuf isn't owned by julia for the root task
1637
+ if (ta != ptls -> root_task ) // stkbuf isn't owned by julia for the root task
1636
1638
#endif
1637
1639
gc_setmark_buf (ta -> stkbuf , gc_bits (jl_astaggedvalue (ta )));
1638
1640
}
1639
- if (ta == jl_all_task_states [ ta -> tid ]. ptls -> current_task ) {
1640
- gc_mark_stack ((jl_value_t * )ta , * jl_all_pgcstacks [ ta -> tid ] , 0 , d );
1641
+ if (ta == ptls -> current_task ) {
1642
+ gc_mark_stack ((jl_value_t * )ta , ptls -> pgcstack , 0 , d );
1641
1643
}
1642
1644
else if (stkbuf ) {
1643
1645
ptrint_t offset ;
1644
1646
#ifdef COPY_STACKS
1645
- offset = (char * )ta -> stkbuf - ((char * )jl_stackbase - ta -> ssize );
1647
+ offset = (char * )ta -> stkbuf - ((char * )ptls -> stackbase - ta -> ssize );
1646
1648
#else
1647
1649
offset = 0 ;
1648
1650
#endif
@@ -1907,8 +1909,6 @@ static void pre_mark(void)
1907
1909
1908
1910
// invisible builtin values
1909
1911
if (jl_an_empty_cell ) gc_push_root (jl_an_empty_cell , 0 );
1910
- gc_push_root (jl_exception_in_transit , 0 );
1911
- gc_push_root (jl_task_arg_in_transit , 0 );
1912
1912
if (jl_module_init_order != NULL )
1913
1913
gc_push_root (jl_module_init_order , 0 );
1914
1914
@@ -2037,7 +2037,7 @@ static void print_obj_profile(htable_t nums, htable_t sizes)
2037
2037
}
2038
2038
}
2039
2039
2040
- void print_obj_profiles (void )
2040
+ static void print_obj_profiles (void )
2041
2041
{
2042
2042
jl_printf (JL_STDERR , "Transient mark :\n" );
2043
2043
print_obj_profile (obj_counts [0 ], obj_sizes [0 ]);
@@ -2054,10 +2054,6 @@ static int saved_mark_sp = 0;
2054
2054
static int sweep_mask = GC_MARKED ;
2055
2055
#define MIN_SCAN_BYTES 1024*1024
2056
2056
2057
- void prepare_sweep (void )
2058
- {
2059
- }
2060
-
2061
2057
JL_DLLEXPORT void jl_gc_collect (int full )
2062
2058
{
2063
2059
if (!is_gc_enabled ) return ;
@@ -2466,8 +2462,9 @@ void jl_print_gc_stats(JL_STREAM *s)
2466
2462
jl_thread_heap_t * jl_mk_thread_heap (void )
2467
2463
{
2468
2464
#ifdef JULIA_ENABLE_THREADING
2469
- // FIXME - should be cache-aligned malloc
2470
- jl_thread_heap = (jl_thread_heap_t * )malloc (sizeof (jl_thread_heap_t ));
2465
+ // Cache-aligned malloc
2466
+ jl_thread_heap =
2467
+ (jl_thread_heap_t * )jl_malloc_aligned (sizeof (jl_thread_heap_t ), 64 );
2471
2468
#endif
2472
2469
FOR_CURRENT_HEAP () {
2473
2470
const int * szc = sizeclasses ;
0 commit comments