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

Eliot Miranda eliot.miranda at gmail.com
Tue Dec 18 17:35:23 UTC 2018


Hi Alistair,

On Mon, Dec 17, 2018 at 10:30 PM Alistair Grant <akgrant0710 at gmail.com>
wrote:

>
> Hi Eliot,
>
> On Sat, Dec 15, 2018 at 04:11:33PM -0800, Eliot Miranda wrote:
> >
> > Hi Alistair,
> >
> > you can do better than using malloc & free in primitiveClosedir et al.
> > If you look at the changes I made in VMMaker.oscog-eem.2490
> > & VMMaker.oscog-eem.2491 you'll see a simple pattern:
> >
> > ...
> >
>
> You are, of course, correct.  By way of excuses: There are a number of
> methods that basically do:
>
>         faPath := calloc(1, sizeof(fapath))
>
> I was debating with myself between whether to allocate fapath (between
> 9K and 64K, depending on platform) on the heap or the stack since
> there's been some recent discussion about using the VM on SoC systems.
>

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.

It's about 30 years since I've dealth with embedded systems (collecting
> statistics on X.25 networks) or really thought about stack and heap
> allocation - I should have just admitted to myself that I'm so far out
> of date that I have no idea. :-)  Anyway, I got caught up on that and
> didn't think about this case.
>
> I'll make the change you suggest, and also move fapath on to the stack
> (primitiveOpendir being the exception) - it will be a bit faster for
> most people.
>
>
>
> > The only thing that;'s unclear for me at the moment is how the result of
> > faInvalidateSessionId: gets tested. result doesn't get set by it. I
> > presume it sets primitive failure, but there';s no test for primitive
> > failure where result is tested (result = 0).
>
> faInvalidateSessionId can't fail, all it does is set the session Id to 0
> to catch the case where someone tries to reuse an invalid fapath within
> a VM session (i.e. after calling primitiveClosedir).
>
> Cheers,
> Alistair
>
>
>
>

-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181218/9b07f8cb/attachment.html>


More information about the Vm-dev mailing list