Re: What exactly the --allinst compiler flag does.

2024-09-28 Thread realhet via Digitalmars-d-learn
Thank You! I just did a test, I did not used the --allinst flag for the first time since 4-5 years. It was a superstition since that, because back then it fixed something. Now to my surprise the test build was successful :D 80KLOC, 20 modules -> 20 obj files, and the full compiling time went

Re: Best practices for class instance variables as parameters

2024-09-28 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Sep 28, 2024 at 06:16:55PM +, Ian via Digitalmars-d-learn wrote: > Hi, > > I'm coming from C and some C++ so the way D stores class instance > variables is new to me. If I'm not mistaken the basic unadorned > instance variable is like a "hidden" pointer. So, when passing class > instan

Re: Best practices for class instance variables as parameters

2024-09-28 Thread Andy Valencia via Digitalmars-d-learn
On Saturday, 28 September 2024 at 18:16:55 UTC, Ian wrote: Hi, I'm coming from C and some C++ so the way D stores class instance variables is new to me. If I'm not mistaken the basic unadorned instance variable is like a "hidden" pointer. So, when passing class instance variables to a functio

Best practices for class instance variables as parameters

2024-09-28 Thread Ian via Digitalmars-d-learn
Hi, I'm coming from C and some C++ so the way D stores class instance variables is new to me. If I'm not mistaken the basic unadorned instance variable is like a "hidden" pointer. So, when passing class instance variables to a function, what would be the point of passing a pointer or ref? I

Re: What exactly the --allinst compiler flag does.

2024-09-28 Thread user1234 via Digitalmars-d-learn
On Saturday, 28 September 2024 at 12:20:43 UTC, realhet wrote: Hi, I have some statements in my mind about --allinst, but I'm not sure they are correct or not. 1. Normally the compiler analyzes the full code with all the modules, and it only compiles code for template things that are used i

What exactly the --allinst compiler flag does.

2024-09-28 Thread realhet via Digitalmars-d-learn
Hi, I have some statements in my mind about --allinst, but I'm not sure they are correct or not. 1. Normally the compiler analyzes the full code with all the modules, and it only compiles code for template things that are used in the given code. 2. It is not needed for compiling the code w

Re: need help to redefine packed c struct in d

2024-09-28 Thread Dakota via Digitalmars-d-learn
On Saturday, 28 September 2024 at 08:35:39 UTC, Johan wrote: On Saturday, 28 September 2024 at 07:54:40 UTC, Dakota wrote: ```c struct __attribute__((packed)) type1 { uint32_tu32; uint8_t u8; uint16_tu16a; uint16_tu16b; uint8_t u8a;

Re: need help to redefine packed c struct in d

2024-09-28 Thread Johan via Digitalmars-d-learn
On Saturday, 28 September 2024 at 07:54:40 UTC, Dakota wrote: ```c struct __attribute__((packed)) type1 { uint32_tu32; uint8_t u8; uint16_tu16a; uint16_tu16b; uint8_t u8a; uint8_t arr[14]; }; ``` the struct size in C is 24: