mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 15:37:51 -04:00
Fix the computation of the aligned size
This commit is contained in:
parent
9287995440
commit
edf57ba352
@ -533,7 +533,7 @@ int64_t scheduler::exec(const std::string& file){
|
||||
void scheduler::sbrk(size_t inc){
|
||||
auto& process = pcb[current_pid].process;
|
||||
|
||||
size_t size = inc + (inc % paging::PAGE_SIZE);
|
||||
size_t size = (inc + paging::PAGE_SIZE - 1) & ~(paging::PAGE_SIZE - 1);
|
||||
size_t pages = size / paging::PAGE_SIZE;
|
||||
|
||||
//Get some physical memory
|
||||
|
Loading…
x
Reference in New Issue
Block a user