core:rt:: Rename LocalServices to Task
This commit is contained in:
@@ -67,7 +67,7 @@ pub fn log_type<T>(level: u32, object: &T) {
|
|||||||
|
|
||||||
fn newsched_log_str(msg: ~str) {
|
fn newsched_log_str(msg: ~str) {
|
||||||
unsafe {
|
unsafe {
|
||||||
match rt::local_services::unsafe_try_borrow_local_services() {
|
match rt::task::unsafe_try_borrow_local_task() {
|
||||||
Some(local) => {
|
Some(local) => {
|
||||||
// Use the available logger
|
// Use the available logger
|
||||||
(*local).logger.log(Left(msg));
|
(*local).logger.log(Left(msg));
|
||||||
|
|||||||
@@ -31,14 +31,8 @@ access to the global heap. Unlike most of `rt` the global heap is
|
|||||||
truly a global resource and generally operates independently of the
|
truly a global resource and generally operates independently of the
|
||||||
rest of the runtime.
|
rest of the runtime.
|
||||||
|
|
||||||
All other runtime features are 'local', either thread-local or
|
All other runtime features are task-local, including the local heap,
|
||||||
task-local. Those critical to the functioning of the language are
|
|
||||||
defined in the module `local_services`. Local services are those which
|
|
||||||
are expected to be available to Rust code generally but rely on
|
|
||||||
thread- or task-local state. These currently include the local heap,
|
|
||||||
the garbage collector, local storage, logging and the stack unwinder.
|
the garbage collector, local storage, logging and the stack unwinder.
|
||||||
Local services are primarily implemented for tasks, but may also
|
|
||||||
be implemented for use outside of tasks.
|
|
||||||
|
|
||||||
The relationship between `rt` and the rest of the core library is
|
The relationship between `rt` and the rest of the core library is
|
||||||
not entirely clear yet and some modules will be moving into or
|
not entirely clear yet and some modules will be moving into or
|
||||||
@@ -67,7 +61,10 @@ use ptr::Ptr;
|
|||||||
/// The global (exchange) heap.
|
/// The global (exchange) heap.
|
||||||
pub mod global_heap;
|
pub mod global_heap;
|
||||||
|
|
||||||
/// The Scheduler and Coroutine types.
|
/// Implementations of language-critical runtime features like @.
|
||||||
|
pub mod task;
|
||||||
|
|
||||||
|
/// The coroutine task scheduler, built on the `io` event loop.
|
||||||
mod sched;
|
mod sched;
|
||||||
|
|
||||||
/// Thread-local access to the current Scheduler.
|
/// Thread-local access to the current Scheduler.
|
||||||
@@ -77,9 +74,6 @@ pub mod local_sched;
|
|||||||
#[path = "io/mod.rs"]
|
#[path = "io/mod.rs"]
|
||||||
pub mod io;
|
pub mod io;
|
||||||
|
|
||||||
/// Thread-local implementations of language-critical runtime features like @.
|
|
||||||
pub mod local_services;
|
|
||||||
|
|
||||||
/// The EventLoop and internal synchronous I/O interface.
|
/// The EventLoop and internal synchronous I/O interface.
|
||||||
mod rtio;
|
mod rtio;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use super::work_queue::WorkQueue;
|
|||||||
use super::stack::{StackPool, StackSegment};
|
use super::stack::{StackPool, StackSegment};
|
||||||
use super::rtio::{EventLoop, EventLoopObject};
|
use super::rtio::{EventLoop, EventLoopObject};
|
||||||
use super::context::Context;
|
use super::context::Context;
|
||||||
use super::local_services::LocalServices;
|
use super::task::Task;
|
||||||
use cell::Cell;
|
use cell::Cell;
|
||||||
|
|
||||||
// A more convenient name for external callers, e.g. `local_sched::take()`
|
// A more convenient name for external callers, e.g. `local_sched::take()`
|
||||||
@@ -350,16 +350,16 @@ pub struct Coroutine {
|
|||||||
/// the task is dead
|
/// the task is dead
|
||||||
priv saved_context: Context,
|
priv saved_context: Context,
|
||||||
/// The heap, GC, unwinding, local storage, logging
|
/// The heap, GC, unwinding, local storage, logging
|
||||||
local_services: LocalServices
|
task: Task
|
||||||
}
|
}
|
||||||
|
|
||||||
pub impl Coroutine {
|
pub impl Coroutine {
|
||||||
fn new(stack_pool: &mut StackPool, start: ~fn()) -> Coroutine {
|
fn new(stack_pool: &mut StackPool, start: ~fn()) -> Coroutine {
|
||||||
Coroutine::with_local(stack_pool, LocalServices::new(), start)
|
Coroutine::with_task(stack_pool, Task::new(), start)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_local(stack_pool: &mut StackPool,
|
fn with_task(stack_pool: &mut StackPool,
|
||||||
local_services: LocalServices,
|
task: Task,
|
||||||
start: ~fn()) -> Coroutine {
|
start: ~fn()) -> Coroutine {
|
||||||
let start = Coroutine::build_start_wrapper(start);
|
let start = Coroutine::build_start_wrapper(start);
|
||||||
let mut stack = stack_pool.take_segment(MIN_STACK_SIZE);
|
let mut stack = stack_pool.take_segment(MIN_STACK_SIZE);
|
||||||
@@ -368,7 +368,7 @@ pub impl Coroutine {
|
|||||||
return Coroutine {
|
return Coroutine {
|
||||||
current_stack_segment: stack,
|
current_stack_segment: stack,
|
||||||
saved_context: initial_context,
|
saved_context: initial_context,
|
||||||
local_services: local_services
|
task: task
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ pub impl Coroutine {
|
|||||||
let sched = local_sched::unsafe_borrow();
|
let sched = local_sched::unsafe_borrow();
|
||||||
let task = (*sched).current_task.get_mut_ref();
|
let task = (*sched).current_task.get_mut_ref();
|
||||||
// FIXME #6141: shouldn't neet to put `start()` in another closure
|
// FIXME #6141: shouldn't neet to put `start()` in another closure
|
||||||
task.local_services.run(||start());
|
task.task.run(||start());
|
||||||
}
|
}
|
||||||
|
|
||||||
let sched = local_sched::take();
|
let sched = local_sched::take();
|
||||||
|
|||||||
@@ -13,11 +13,6 @@
|
|||||||
//! local storage, and logging. Even a 'freestanding' Rust would likely want
|
//! local storage, and logging. Even a 'freestanding' Rust would likely want
|
||||||
//! to implement this.
|
//! to implement this.
|
||||||
|
|
||||||
//! Local services may exist in at least three different contexts:
|
|
||||||
//! when running as a task, when running in the scheduler's context,
|
|
||||||
//! or when running outside of a scheduler but with local services
|
|
||||||
//! (freestanding rust with local services?).
|
|
||||||
|
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
use libc::{c_void, uintptr_t};
|
use libc::{c_void, uintptr_t};
|
||||||
use cast::transmute;
|
use cast::transmute;
|
||||||
@@ -25,7 +20,7 @@ use super::sched::local_sched;
|
|||||||
use super::local_heap::LocalHeap;
|
use super::local_heap::LocalHeap;
|
||||||
use rt::logging::StdErrLogger;
|
use rt::logging::StdErrLogger;
|
||||||
|
|
||||||
pub struct LocalServices {
|
pub struct Task {
|
||||||
heap: LocalHeap,
|
heap: LocalHeap,
|
||||||
gc: GarbageCollector,
|
gc: GarbageCollector,
|
||||||
storage: LocalStorage,
|
storage: LocalStorage,
|
||||||
@@ -41,9 +36,9 @@ pub struct Unwinder {
|
|||||||
unwinding: bool,
|
unwinding: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LocalServices {
|
impl Task {
|
||||||
pub fn new() -> LocalServices {
|
pub fn new() -> Task {
|
||||||
LocalServices {
|
Task {
|
||||||
heap: LocalHeap::new(),
|
heap: LocalHeap::new(),
|
||||||
gc: GarbageCollector,
|
gc: GarbageCollector,
|
||||||
storage: LocalStorage(ptr::null(), None),
|
storage: LocalStorage(ptr::null(), None),
|
||||||
@@ -53,8 +48,8 @@ impl LocalServices {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn without_unwinding() -> LocalServices {
|
pub fn without_unwinding() -> Task {
|
||||||
LocalServices {
|
Task {
|
||||||
heap: LocalHeap::new(),
|
heap: LocalHeap::new(),
|
||||||
gc: GarbageCollector,
|
gc: GarbageCollector,
|
||||||
storage: LocalStorage(ptr::null(), None),
|
storage: LocalStorage(ptr::null(), None),
|
||||||
@@ -66,9 +61,9 @@ impl LocalServices {
|
|||||||
|
|
||||||
pub fn run(&mut self, f: &fn()) {
|
pub fn run(&mut self, f: &fn()) {
|
||||||
// This is just an assertion that `run` was called unsafely
|
// This is just an assertion that `run` was called unsafely
|
||||||
// and this instance of LocalServices is still accessible.
|
// and this instance of Task is still accessible.
|
||||||
do borrow_local_services |sched| {
|
do borrow_local_task |task| {
|
||||||
assert!(ptr::ref_eq(sched, self));
|
assert!(ptr::ref_eq(task, self));
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.unwinder {
|
match self.unwinder {
|
||||||
@@ -86,14 +81,14 @@ impl LocalServices {
|
|||||||
|
|
||||||
/// Must be called manually before finalization to clean up
|
/// Must be called manually before finalization to clean up
|
||||||
/// thread-local resources. Some of the routines here expect
|
/// thread-local resources. Some of the routines here expect
|
||||||
/// LocalServices to be available recursively so this must be
|
/// Task to be available recursively so this must be
|
||||||
/// called unsafely, without removing LocalServices from
|
/// called unsafely, without removing Task from
|
||||||
/// thread-local-storage.
|
/// thread-local-storage.
|
||||||
fn destroy(&mut self) {
|
fn destroy(&mut self) {
|
||||||
// This is just an assertion that `destroy` was called unsafely
|
// This is just an assertion that `destroy` was called unsafely
|
||||||
// and this instance of LocalServices is still accessible.
|
// and this instance of Task is still accessible.
|
||||||
do borrow_local_services |sched| {
|
do borrow_local_task |task| {
|
||||||
assert!(ptr::ref_eq(sched, self));
|
assert!(ptr::ref_eq(task, self));
|
||||||
}
|
}
|
||||||
match self.storage {
|
match self.storage {
|
||||||
LocalStorage(ptr, Some(ref dtor)) => {
|
LocalStorage(ptr, Some(ref dtor)) => {
|
||||||
@@ -105,7 +100,7 @@ impl LocalServices {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for LocalServices {
|
impl Drop for Task {
|
||||||
fn finalize(&self) { assert!(self.destroyed) }
|
fn finalize(&self) { assert!(self.destroyed) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,11 +151,11 @@ impl Unwinder {
|
|||||||
|
|
||||||
/// Borrow a pointer to the installed local services.
|
/// Borrow a pointer to the installed local services.
|
||||||
/// Fails (likely aborting the process) if local services are not available.
|
/// Fails (likely aborting the process) if local services are not available.
|
||||||
pub fn borrow_local_services(f: &fn(&mut LocalServices)) {
|
pub fn borrow_local_task(f: &fn(&mut Task)) {
|
||||||
do local_sched::borrow |sched| {
|
do local_sched::borrow |sched| {
|
||||||
match sched.current_task {
|
match sched.current_task {
|
||||||
Some(~ref mut task) => {
|
Some(~ref mut task) => {
|
||||||
f(&mut task.local_services)
|
f(&mut task.task)
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
fail!("no local services for schedulers yet")
|
fail!("no local services for schedulers yet")
|
||||||
@@ -169,10 +164,10 @@ pub fn borrow_local_services(f: &fn(&mut LocalServices)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn unsafe_borrow_local_services() -> *mut LocalServices {
|
pub unsafe fn unsafe_borrow_local_task() -> *mut Task {
|
||||||
match (*local_sched::unsafe_borrow()).current_task {
|
match (*local_sched::unsafe_borrow()).current_task {
|
||||||
Some(~ref mut task) => {
|
Some(~ref mut task) => {
|
||||||
let s: *mut LocalServices = &mut task.local_services;
|
let s: *mut Task = &mut task.task;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
@@ -182,9 +177,9 @@ pub unsafe fn unsafe_borrow_local_services() -> *mut LocalServices {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn unsafe_try_borrow_local_services() -> Option<*mut LocalServices> {
|
pub unsafe fn unsafe_try_borrow_local_task() -> Option<*mut Task> {
|
||||||
if local_sched::exists() {
|
if local_sched::exists() {
|
||||||
Some(unsafe_borrow_local_services())
|
Some(unsafe_borrow_local_task())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ use option::*;
|
|||||||
use cell::Cell;
|
use cell::Cell;
|
||||||
use result::{Result, Ok, Err};
|
use result::{Result, Ok, Err};
|
||||||
use super::io::net::ip::{IpAddr, Ipv4};
|
use super::io::net::ip::{IpAddr, Ipv4};
|
||||||
use rt::local_services::LocalServices;
|
use rt::task::Task;
|
||||||
use rt::thread::Thread;
|
use rt::thread::Thread;
|
||||||
|
|
||||||
/// Creates a new scheduler in a new thread and runs a task in it,
|
/// Creates a new scheduler in a new thread and runs a task in it,
|
||||||
@@ -28,8 +28,8 @@ pub fn run_in_newsched_task(f: ~fn()) {
|
|||||||
|
|
||||||
do run_in_bare_thread {
|
do run_in_bare_thread {
|
||||||
let mut sched = ~UvEventLoop::new_scheduler();
|
let mut sched = ~UvEventLoop::new_scheduler();
|
||||||
let task = ~Coroutine::with_local(&mut sched.stack_pool,
|
let task = ~Coroutine::with_task(&mut sched.stack_pool,
|
||||||
LocalServices::without_unwinding(),
|
Task::without_unwinding(),
|
||||||
f.take());
|
f.take());
|
||||||
sched.enqueue_task(task);
|
sched.enqueue_task(task);
|
||||||
sched.run();
|
sched.run();
|
||||||
@@ -41,8 +41,8 @@ pub fn spawntask(f: ~fn()) {
|
|||||||
use super::sched::*;
|
use super::sched::*;
|
||||||
|
|
||||||
let mut sched = local_sched::take();
|
let mut sched = local_sched::take();
|
||||||
let task = ~Coroutine::with_local(&mut sched.stack_pool,
|
let task = ~Coroutine::with_task(&mut sched.stack_pool,
|
||||||
LocalServices::without_unwinding(),
|
Task::without_unwinding(),
|
||||||
f);
|
f);
|
||||||
do sched.switch_running_tasks_and_then(task) |task| {
|
do sched.switch_running_tasks_and_then(task) |task| {
|
||||||
let task = Cell(task);
|
let task = Cell(task);
|
||||||
@@ -56,8 +56,8 @@ pub fn spawntask_immediately(f: ~fn()) {
|
|||||||
use super::sched::*;
|
use super::sched::*;
|
||||||
|
|
||||||
let mut sched = local_sched::take();
|
let mut sched = local_sched::take();
|
||||||
let task = ~Coroutine::with_local(&mut sched.stack_pool,
|
let task = ~Coroutine::with_task(&mut sched.stack_pool,
|
||||||
LocalServices::without_unwinding(),
|
Task::without_unwinding(),
|
||||||
f);
|
f);
|
||||||
do sched.switch_running_tasks_and_then(task) |task| {
|
do sched.switch_running_tasks_and_then(task) |task| {
|
||||||
let task = Cell(task);
|
let task = Cell(task);
|
||||||
@@ -72,8 +72,8 @@ pub fn spawntask_later(f: ~fn()) {
|
|||||||
use super::sched::*;
|
use super::sched::*;
|
||||||
|
|
||||||
let mut sched = local_sched::take();
|
let mut sched = local_sched::take();
|
||||||
let task = ~Coroutine::with_local(&mut sched.stack_pool,
|
let task = ~Coroutine::with_task(&mut sched.stack_pool,
|
||||||
LocalServices::without_unwinding(),
|
Task::without_unwinding(),
|
||||||
f);
|
f);
|
||||||
|
|
||||||
sched.enqueue_task(task);
|
sched.enqueue_task(task);
|
||||||
@@ -89,8 +89,8 @@ pub fn spawntask_random(f: ~fn()) {
|
|||||||
let run_now: bool = Rand::rand(&mut rng);
|
let run_now: bool = Rand::rand(&mut rng);
|
||||||
|
|
||||||
let mut sched = local_sched::take();
|
let mut sched = local_sched::take();
|
||||||
let task = ~Coroutine::with_local(&mut sched.stack_pool,
|
let task = ~Coroutine::with_task(&mut sched.stack_pool,
|
||||||
LocalServices::without_unwinding(),
|
Task::without_unwinding(),
|
||||||
f);
|
f);
|
||||||
|
|
||||||
if run_now {
|
if run_now {
|
||||||
@@ -155,8 +155,8 @@ pub fn spawntask_thread(f: ~fn()) -> Thread {
|
|||||||
let f = Cell(f);
|
let f = Cell(f);
|
||||||
let thread = do Thread::start {
|
let thread = do Thread::start {
|
||||||
let mut sched = ~UvEventLoop::new_scheduler();
|
let mut sched = ~UvEventLoop::new_scheduler();
|
||||||
let task = ~Coroutine::with_local(&mut sched.stack_pool,
|
let task = ~Coroutine::with_task(&mut sched.stack_pool,
|
||||||
LocalServices::without_unwinding(),
|
Task::without_unwinding(),
|
||||||
f.take());
|
f.take());
|
||||||
sched.enqueue_task(task);
|
sched.enqueue_task(task);
|
||||||
sched.run();
|
sched.run();
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ impl FailWithCause for &'static str {
|
|||||||
pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
|
pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
|
||||||
use option::Option;
|
use option::Option;
|
||||||
use rt::{context, OldTaskContext, TaskContext};
|
use rt::{context, OldTaskContext, TaskContext};
|
||||||
use rt::local_services::{unsafe_borrow_local_services, Unwinder};
|
use rt::task::{unsafe_borrow_local_task, Unwinder};
|
||||||
|
|
||||||
let context = context();
|
let context = context();
|
||||||
match context {
|
match context {
|
||||||
@@ -233,8 +233,8 @@ pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
|
|||||||
|
|
||||||
gc::cleanup_stack_for_failure();
|
gc::cleanup_stack_for_failure();
|
||||||
|
|
||||||
let local_services = unsafe_borrow_local_services();
|
let task = unsafe_borrow_local_task();
|
||||||
let unwinder: &mut Option<Unwinder> = &mut (*local_services).unwinder;
|
let unwinder: &mut Option<Unwinder> = &mut (*task).unwinder;
|
||||||
match *unwinder {
|
match *unwinder {
|
||||||
Some(ref mut unwinder) => unwinder.begin_unwind(),
|
Some(ref mut unwinder) => unwinder.begin_unwind(),
|
||||||
None => abort!("failure without unwinder. aborting process")
|
None => abort!("failure without unwinder. aborting process")
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use task::rt;
|
|||||||
use local_data::LocalDataKey;
|
use local_data::LocalDataKey;
|
||||||
|
|
||||||
use super::rt::rust_task;
|
use super::rt::rust_task;
|
||||||
use rt::local_services::LocalStorage;
|
use rt::task::LocalStorage;
|
||||||
|
|
||||||
pub enum Handle {
|
pub enum Handle {
|
||||||
OldHandle(*rust_task),
|
OldHandle(*rust_task),
|
||||||
@@ -28,15 +28,15 @@ pub enum Handle {
|
|||||||
impl Handle {
|
impl Handle {
|
||||||
pub fn new() -> Handle {
|
pub fn new() -> Handle {
|
||||||
use rt::{context, OldTaskContext};
|
use rt::{context, OldTaskContext};
|
||||||
use rt::local_services::unsafe_borrow_local_services;
|
use rt::task::unsafe_borrow_local_task;
|
||||||
unsafe {
|
unsafe {
|
||||||
match context() {
|
match context() {
|
||||||
OldTaskContext => {
|
OldTaskContext => {
|
||||||
OldHandle(rt::rust_get_task())
|
OldHandle(rt::rust_get_task())
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let local_services = unsafe_borrow_local_services();
|
let task = unsafe_borrow_local_task();
|
||||||
NewHandle(&mut (*local_services).storage)
|
NewHandle(&mut (*task).storage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ pub fn failing() -> bool {
|
|||||||
//! True if the running task has failed
|
//! True if the running task has failed
|
||||||
|
|
||||||
use rt::{context, OldTaskContext};
|
use rt::{context, OldTaskContext};
|
||||||
use rt::local_services::borrow_local_services;
|
use rt::task::borrow_local_task;
|
||||||
|
|
||||||
match context() {
|
match context() {
|
||||||
OldTaskContext => {
|
OldTaskContext => {
|
||||||
@@ -514,7 +514,7 @@ pub fn failing() -> bool {
|
|||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let mut unwinding = false;
|
let mut unwinding = false;
|
||||||
do borrow_local_services |local| {
|
do borrow_local_task |local| {
|
||||||
unwinding = match local.unwinder {
|
unwinding = match local.unwinder {
|
||||||
Some(unwinder) => {
|
Some(unwinder) => {
|
||||||
unwinder.unwinding
|
unwinder.unwinding
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use managed::raw::BoxRepr;
|
|||||||
use str;
|
use str;
|
||||||
use sys;
|
use sys;
|
||||||
use rt::{context, OldTaskContext};
|
use rt::{context, OldTaskContext};
|
||||||
use rt::local_services::borrow_local_services;
|
use rt::task::borrow_local_task;
|
||||||
use option::{Option, Some, None};
|
use option::{Option, Some, None};
|
||||||
use io;
|
use io;
|
||||||
use rt::global_heap;
|
use rt::global_heap;
|
||||||
@@ -243,8 +243,8 @@ pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
|
|||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let mut alloc = ::ptr::null();
|
let mut alloc = ::ptr::null();
|
||||||
do borrow_local_services |srv| {
|
do borrow_local_task |task| {
|
||||||
alloc = srv.heap.alloc(td as *c_void, size as uint) as *c_char;
|
alloc = task.heap.alloc(td as *c_void, size as uint) as *c_char;
|
||||||
}
|
}
|
||||||
return alloc;
|
return alloc;
|
||||||
}
|
}
|
||||||
@@ -261,8 +261,8 @@ pub unsafe fn local_free(ptr: *c_char) {
|
|||||||
rustrt::rust_upcall_free_noswitch(ptr);
|
rustrt::rust_upcall_free_noswitch(ptr);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
do borrow_local_services |srv| {
|
do borrow_local_task |task| {
|
||||||
srv.heap.free(ptr as *c_void);
|
task.heap.free(ptr as *c_void);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user