swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSTRDUP & memory management; file i/o tests and related


From: William S. Shu
Subject: Re: SSTRDUP & memory management; file i/o tests and related
Date: Mon, 18 Oct 1999 19:33:23 +0100

Thanks Marcus,
I wanted a quick-and-dirty, but robust, way of initialising arrays (1- or 2-d
arrays, perhaps also 3-d) within an object, as I ObjectLoader does not seem to
do this.   (I am to save objects [or their components] later, but I have not
considered that yet).  Quick-and-dirty is because my focus & priorities are not
yet on I/O.  Furthermore, I am wary of memory violation problems if I
(casually?) mix Swarm and C memory allocation schemes.

Unfortunately, I can't yet upgrade to 2.0.1 until I have found a bug that shows
up in a batchSwarm run of my program, but not in the observerSwarm run.  (
Essentially, objects which should be on a swarm list are found when using an
obersever swarm, but are absent when using a batch swarm (I receive printf
warnings for these).  Identical code is used in both types of runs, except for
the batch/observer swarms.  The error seems benign, but I want to first figure
out why.  (I re-use allocated objects.))

Thanks,

William.


"Marcus G. Daniels" wrote:

> >>>>> "WS" == William S Shu <address@hidden> writes:
>
> WS> I do not know how to deAllocate any memory claimed by SSTRDUP.
>
> SFREEBLOCK, which is a macro that sends the scratchZone the free: method
> with the block as an argument.
>
> WS> On a separate note, how does one detect/test for end-of-line,
> WS> end-of-file, read error, etc., after creating one with, say,
> WS> f = [InFile create: [self getZone] withName: buf];
>
> The various getWhatever methods in InFile have poor error handling
> properties, they just return 0 if an input failed or 1 if it was successful.
> It has been this way for a long time, and existing apps depend on
> these poor properties.
>
> I urge you not to use this class and suggest using Archiver for data
> handling.  If it isn't clear how to do that, describe your problem and
> I'll describe the solution.
>
> If for some reason you don't want to do that, I suggest using stdio
> directly.  In my opinion, InFile is worse than nothing.
>
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]