[Vm-dev] About SQFile's fileSize field
Levente Uzonyi
leves at caesar.elte.hu
Wed Oct 11 20:40:34 UTC 2017
I went ahead a bit, removed the field, updated the sources, and compiled a
VM with the changes. It works fine on linux. I've updated the windows and
mac files too, but I can't test those.
There are some remaining references to the removed field in the RiscOS
platforms file, but I don't really know what to do with that. The code
seems to be using platform specific calls to implement the plugin, which
is unusual, but may be more efficient than the generic C implementation.
Anyway, the code is on github[1]. I'll create a pull request once someone
says something about the idea.
Levente
[1] https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/Cog...smalltalking:Cog
On Tue, 10 Oct 2017, Levente Uzonyi wrote:
>
> Hi All,
>
> The SQFile struct[1] has a field named fileSize, which is used to cache[2]
> the size of the file when such property makes sense.
> This caching behavior seems unnecessary, and it causes synchronization
> problems between multiple SQFile structures of a single file. The latter
> could be worked around by updating the cached value more often, but I was
> wondering why is the value cached at all. Does anyone know?
>
> Levente
>
> [1]
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Cross/plugins/FilePlugin/FilePlugin.h
> [2]
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
>
More information about the Vm-dev
mailing list