Re: How to map machine instctions in memory and execute them? (Aka, how to create a loader)

2022-06-08 Thread max haughton via Digitalmars-d-learn
On Monday, 6 June 2022 at 15:13:45 UTC, rempas wrote: I tried to find anything that will show code but I wasn't able to find anything expect for an answer on stackoverflow. I would find a lot of theory but no practical code that works. What I want to do is allocate memory (with execution

Re: How to map machine instctions in memory and execute them? (Aka, how to create a loader)

2022-06-08 Thread rempas via Digitalmars-d-learn
On Monday, 6 June 2022 at 15:13:45 UTC, rempas wrote: In case someone is wondering, I found an answer in another forum. The code is the following: ```d import core.stdc.stdio; import core.stdc.string; import core.stdc.stdlib; import core.sys.posix.sys.mman; void putbytes(char **code, const

Re: C-like static array size inference - how?

2022-06-08 Thread forkit via Digitalmars-d-learn
On Wednesday, 8 June 2022 at 01:32:42 UTC, Steven Schveighoffer wrote: I like `$`. It's got a well-defined meaning, and already is somewhat magic. -Steve I agree it's magic. warray[5..$] - this is one of the best uses of syntax magic in D! I think it's what first attracted me to the