Selaa lähdekoodia

change: replace some _new with operator new

greatbridf 2 vuotta sitten
vanhempi
commit
0471ee9813

+ 1 - 1
include/kernel/process.hpp

@@ -156,7 +156,7 @@ public:
     public:
         inline static void init_global_file_container(void)
         {
-            files = types::pnew<types::kernel_allocator>(files);
+            files = new container_type;
         }
 
     private:

+ 1 - 1
src/kernel/event/event.cpp

@@ -17,7 +17,7 @@ namespace event {
 ::types::list<::input_event>& input_event_queue(void)
 {
     if (!_input_event_queue) {
-        _input_event_queue = types::pnew<types::kernel_allocator>(_input_event_queue);
+        _input_event_queue = new types::list<input_event>;
     }
     return *_input_event_queue;
 }

+ 4 - 4
src/kernel/hw/ata.cpp

@@ -203,13 +203,13 @@ static inline void mbr_part_probe(fs::inode* drive, uint16_t major, uint16_t min
 SECTION(".text.kinit")
 void hw::init_ata(void)
 {
-    ata_pri = types::pnew<types::kernel_allocator>(ata_pri, ATA_PRIMARY_BUS_BASE);
+    ata_pri = new hw::ata(ATA_PRIMARY_BUS_BASE);
     if (ata_pri->identify())
         ata_pri->select(true);
 
-    ata_sec = types::pnew<types::kernel_allocator>(ata_pri, ATA_SECONDARY_BUS_BASE);
-    if (ata_pri->identify())
-        ata_pri->select(true);
+    ata_sec = new hw::ata(ATA_SECONDARY_BUS_BASE);
+    if (ata_sec->identify())
+        ata_sec->select(true);
 
     // data1: offset sectors
     // data2: limit sectors

+ 3 - 3
src/kernel/process.cpp

@@ -244,7 +244,7 @@ void NORETURN _kernel_init(void)
     // TODO: parse kernel parameters
     auto* drive = fs::vfs_open("/dev/hda1");
     assert(drive);
-    auto* _new_fs = fs::register_fs(types::_new<types::kernel_allocator, fs::fat::fat32>(drive->ind));
+    auto* _new_fs = fs::register_fs(new fs::fat::fat32(drive->ind));
     auto* mnt = fs::vfs_open("/mnt");
     assert(mnt);
     int ret = fs::fs_root->ind->fs->mount(mnt, _new_fs);
@@ -296,8 +296,8 @@ void k_new_thread(void (*func)(void*), void* data)
 SECTION(".text.kinit")
 void NORETURN init_scheduler(void)
 {
-    procs = types::pnew<types::kernel_allocator>(procs);
-    readythds = types::pnew<types::kernel_allocator>(readythds);
+    procs = new proclist;
+    readythds = new readyqueue;
 
     process::filearr::init_global_file_container();
 

+ 1 - 1
src/kernel/vfs.cpp

@@ -603,7 +603,7 @@ void init_vfs(void)
 
     fs_es = types::pnew<types::kernel_ident_allocator>(fs_es);
 
-    auto* rootfs = types::_new<types::kernel_allocator, tmpfs>();
+    auto* rootfs = new tmpfs;
     fs_es->push_back(rootfs);
     fs_root = rootfs->root();