[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] FileAttributesPlugin 2.0.6 (#321)

tim Rowledge tim at rowledge.org
Wed Dec 19 17:38:31 UTC 2018

> On 2018-12-18, at 10:55 PM, Alistair Grant <akgrant0710 at gmail.com> wrote:
> Hi Eliot,
> On Tue, 18 Dec 2018 at 18:35, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> Oh wow, I had no realization it was that bug.  I had assumed it was the size of a path, i.e. only a few hindered bytes at max.  If it is that big I think the way you're doing things is fine.  I would just ask you to comment the code as being that way because it is that big.
> There are two structures being allocated.  The one you provided the
> code for is small - an integer plus a pointer.  The other one, which
> has enough room for any path is the big one.  It holds the path in
> UTF8 (as passed from the image) and in the platform's native format,
> which for Windows is 32K 16 bit words.

Good grief, that's huge. Is there no mechanism for querying the size to allow correct allocation? RISC OS has a number of similar APIs where you basically do
val = thingyCall(param1, paramN, 0);
allocate(buffer, val);
result = thingyCall(param1, paramN, *buffer);

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
CITOKATE - Criticism is the Only Known Antidote to Error

More information about the Vm-dev mailing list