Skip to content

Commit 0bbca98

Browse files
committed
Remove jl_task_stack_buffer
It has been deprecated and unused since October 2020. While it doesn't hurt us actively, it is code that needs to be adjusted for changes to task and TLS handling for no benefit.
1 parent 4366a93 commit 0bbca98

File tree

3 files changed

+0
-38
lines changed

3 files changed

+0
-38
lines changed

src/jl_exported_funcs.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@
454454
XX(jl_tagged_gensym) \
455455
XX(jl_take_buffer) \
456456
XX(jl_task_get_next) \
457-
XX(jl_task_stack_buffer) \
458457
XX(jl_termios_size) \
459458
XX(jl_test_cpu_feature) \
460459
XX(jl_threadid) \

src/julia_gcext.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ JL_DLLEXPORT int jl_gc_conservative_gc_support_enabled(void);
135135
// NOTE: Only valid to call from within a GC context.
136136
JL_DLLEXPORT jl_value_t *jl_gc_internal_obj_base_ptr(void *p);
137137

138-
// Return a non-null pointer to the start of the stack area if the task
139-
// has an associated stack buffer. In that case, *size will also contain
140-
// the size of that stack buffer upon return. Also, if task is a thread's
141-
// current task, that thread's id will be stored in *tid; otherwise,
142-
// *tid will be set to -1.
143-
//
144-
// DEPRECATED: use jl_active_task_stack() instead.
145-
JL_DLLEXPORT void *jl_task_stack_buffer(jl_task_t *task, size_t *size, int *tid);
146-
147138
// Query the active and total stack range for the given task, and set
148139
// *active_start and *active_end respectively *total_start and *total_end
149140
// accordingly. The range for the active part is a best-effort approximation

src/task.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -326,34 +326,6 @@ void JL_NORETURN jl_finish_task(jl_task_t *ct)
326326
abort();
327327
}
328328

329-
JL_DLLEXPORT void *jl_task_stack_buffer(jl_task_t *task, size_t *size, int *ptid)
330-
{
331-
size_t off = 0;
332-
#ifndef _OS_WINDOWS_
333-
jl_ptls_t ptls0 = jl_atomic_load_relaxed(&jl_all_tls_states)[0];
334-
if (ptls0->root_task == task) {
335-
// See jl_init_root_task(). The root task of the main thread
336-
// has its buffer enlarged by an artificial 3000000 bytes, but
337-
// that means that the start of the buffer usually points to
338-
// inaccessible memory. We need to correct for this.
339-
off = ROOT_TASK_STACK_ADJUSTMENT;
340-
}
341-
#endif
342-
jl_ptls_t ptls2 = task->ptls;
343-
*ptid = -1;
344-
if (ptls2) {
345-
*ptid = jl_atomic_load_relaxed(&task->tid);
346-
#ifdef COPY_STACKS
347-
if (task->copy_stack) {
348-
*size = ptls2->stacksize;
349-
return (char *)ptls2->stackbase - *size;
350-
}
351-
#endif
352-
}
353-
*size = task->bufsz - off;
354-
return (void *)((char *)task->stkbuf + off);
355-
}
356-
357329
JL_DLLEXPORT void jl_active_task_stack(jl_task_t *task,
358330
char **active_start, char **active_end,
359331
char **total_start, char **total_end)

0 commit comments

Comments
 (0)