Skip to content

Commit e556238

Browse files
authored
chore: remove heap_bottom since it's unused (#105)
1 parent dab1fb5 commit e556238

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

api/src/syscall/task/clone.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ pub fn sys_clone(
183183
);
184184
proc_data.set_umask(old_proc_data.umask());
185185
// Inherit heap pointers from parent to ensure child's heap state is consistent after fork
186-
proc_data.set_heap_bottom(old_proc_data.get_heap_bottom());
187186
proc_data.set_heap_top(old_proc_data.get_heap_top());
188187

189188
{

api/src/syscall/task/execve.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub fn sys_execve(
6060
*proc_data.exe_path.write() = loc.absolute_path()?.to_string();
6161
*proc_data.cmdline.write() = Arc::new(args);
6262

63-
proc_data.set_heap_bottom(USER_HEAP_BASE);
6463
proc_data.set_heap_top(USER_HEAP_BASE);
6564

6665
*proc_data.signal.actions.lock() = Default::default();

core/src/task.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ pub struct ProcessData {
201201
pub aspace: Arc<Mutex<AddrSpace>>,
202202
/// The resource scope
203203
pub scope: RwLock<Scope>,
204-
/// The user heap bottom
205-
heap_bottom: AtomicUsize,
206204
/// The user heap top
207205
heap_top: AtomicUsize,
208206

@@ -242,7 +240,6 @@ impl ProcessData {
242240
cmdline: RwLock::new(cmdline),
243241
aspace,
244242
scope: RwLock::new(Scope::new()),
245-
heap_bottom: AtomicUsize::new(crate::config::USER_HEAP_BASE),
246243
heap_top: AtomicUsize::new(crate::config::USER_HEAP_BASE),
247244

248245
rlim: RwLock::default(),
@@ -262,16 +259,6 @@ impl ProcessData {
262259
})
263260
}
264261

265-
/// Get the bottom address of the user heap.
266-
pub fn get_heap_bottom(&self) -> usize {
267-
self.heap_bottom.load(Ordering::Acquire)
268-
}
269-
270-
/// Set the bottom address of the user heap.
271-
pub fn set_heap_bottom(&self, bottom: usize) {
272-
self.heap_bottom.store(bottom, Ordering::Release)
273-
}
274-
275262
/// Get the top address of the user heap.
276263
pub fn get_heap_top(&self) -> usize {
277264
self.heap_top.load(Ordering::Acquire)

0 commit comments

Comments
 (0)