[comp.sys.amiga.tech] FreePotBits

cs161agc@sdcc10.ucsd.EDU (John Schultz) (01/21/89)

  FreePotBits does nothing.  Is this bug so well
known that no one talks about it?  Here's an example code fragment:

  // open the potgo resource etc.

  allocmask = AllocPotBits(MASK);
  if (allocmask != MASK) {
    printf("error blah blah...");
    FreePotBits(allocmask);
    exit(0);
  } // end if

  FreePotBits(allocmask);

// end of program fragment

  A program containg the above code will run the first time, but
will not be able to allocate the bits the second time.  If I have
done something wrong, what is the correct way?  I've written the
exact code in Benchmark and get the same result, so I don't think
the problem is with Lattice.


  Thanks,

  John Schultz
 

johnhlee@cory.Berkeley.EDU (John Lee) (01/23/89)

In article <64@sdcc10.ucsd.EDU> cs161agc@sdcc10.ucsd.edu.UUCP (John Schultz) writes:
<
<
<  FreePotBits does nothing.  Is this bug so well
<known that no one talks about it?  Here's an example code fragment:
<
<  // open the potgo resource etc.
<
<  allocmask = AllocPotBits(MASK);
Ah.  Here's your problem.   ^^^^ That should be AllocPotBits(MASK, PotgoBase).
<  if (allocmask != MASK) {
<    printf("error blah blah...");
<    FreePotBits(allocmask);
                 ^^^^^^^^^ FreePotBits(allocmask, PotgoBase)
<    exit(0);
<  } // end if
<
<  FreePotBits(allocmask);
               ^^^^^^^^^ ditto.
<// end of program fragment
<
[...]
<  Thanks,
<
<  John Schultz
< 
------------------------------------------------------------------------------
Raining CATS & DOGS?  Join the RATS: Remote Amiga Teleconferencing System.
ARPAnet: johnhlee@cory.Berkeley.EDU		John Lee
UUCP:    ...!ucbvax!cory!johnhlee

cs161agc@sdcc10.ucsd.EDU (John Schultz) (01/24/89)

In article <8999@pasteur.Berkeley.EDU> johnhlee@cory.Berkeley.EDU.UUCP (John Lee) writes:
><  allocmask = AllocPotBits(MASK);
>Ah.  Here's your problem.   ^^^^ That should be AllocPotBits(MASK, PotgoBase).

  That makes sense.  I should really get some updated docs (for the
C end). As for Benchmark, *there is only ONE argument* to these
functions.  I'll talk to Leon about this and see if it has been
corrected in the latest version of Benchmark.

>ARPAnet: johnhlee@cory.Berkeley.EDU		John Lee

  Thanks,


  John Schultz