OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:38 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: New isn't calling the constructor
PostPosted: Fri Mar 30, 2018 11:45 am 
Offline

Joined: Wed Apr 10, 2013 3:44 pm
Posts: 2
I have been debugging my OS and I have noticed that `new` isn't actually calling the constructor. I found the issue here because the print statement here don't run. My new operator is defined here.

Any help would be appreciated.


Top
 Profile  
 
 Post subject: Re: New isn't calling the constructor
PostPosted: Fri Mar 30, 2018 12:28 pm 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
This is not OS dev related but a basic C++ question. New is calling the default constructor and your printf is inside another constructor.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: New isn't calling the constructor
PostPosted: Fri Mar 30, 2018 1:14 pm 
Offline

Joined: Wed Apr 10, 2013 3:44 pm
Posts: 2
I just noticed that thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 54 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group