~skeeto/public-inbox

1

Re: Legitimate-ish Use of alloca()

Alexander Shpilkin <ashpilkin@gmail.com>
Details
Message ID
<CAAiuFs8yNgsHWZy=hTtMb1S3Qc6Szz+x=xE07UekcdMyjCy+Nw@mail.gmail.com>
DKIM signature
missing
Download raw message
This is strictly of historical interest, but SOM, IBM's stillborn
competitor to Microsoft COM and a foundational component in the
ill-fated OpenDoc, included among its many complexities stack
allocation of objects.  It worked[1] basically the way the post
describes:  discover the class size (somGetInstanceSize), alloca() that
much memory, then pass it to "placement new" (somRenewNoInitNoZero).

It would be interesting to know if modern OO systems that manage memory
and attempt ABI compatibility (e.g. Swift) also work this way.

[1] Hamilton, "Programming with Direct-to-SOM C++", chapter 6;
    https://archive.org/details/ProgrammingWithDirectToSOMC/page/n145

-- 
Cheers,
Alex

Re: Legitimate-ish Use of alloca()

Details
Message ID
<20230427001023.jm6z3vxgbanx3ktv@nullprogram.com>
In-Reply-To
<CAAiuFs8yNgsHWZy=hTtMb1S3Qc6Szz+x=xE07UekcdMyjCy+Nw@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Interesting! Thanks, Alexander! While I'm not surprised this sort of thing 
didn't take off, it's interesting to see that it was actually used in a 
real system long ago.
Reply to thread Export thread (mbox)