>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

  DS> 2) A buffer object has the structure:

  DS>     struct {
  DS>        void *memory;
  DS>        INTVAL size;
  DS>     }

some questions.

i am declaring a BIGNUM struct which points to an array of BIGNUM_WORDs
(longest native integers). do i have to declare it like that? or will
the GC work with any pointer type and cast it for me?

also since some platforms require alignment, will i be able to assure
that buffer is BIGNUM_WORD aligned?

finally, i need the size in BIGNUM_WORDs. so should i have both a byte
size as you do and my own count of BIGNUM_WORDs?

and since we are on this topic, how worried should i be about freeing or
not? there will be times when the BIGNUM package will need to allocate
BIGNUM temps and can then explicitly reuse or free them. should (some
form of) free be called or should i let the memory leak for the GC to
pick up later? there will also be needs for realloc type calls. will
there be support for that? what about allocating zeroed memory (i know
bzero is easy to call) which make life simpler for BIGNUM?

BTW we have basic multiword BCD add subtract working. scaling and
conversions are next. then we do multiply and divide and other stuff. we
will need to discuss scaling limits soon. isn't that a language issue
too? limiting BIGNUM fractional digits is a semantic issue that needs to
be addressed at the language level. how does the coder specify the
scaling behavior of a BIGNUM? what about conversions, math operations,
etc.? ANSI PL/I spent a great deal on this subject and it gets very ugly
fast. i will propose some questions and ideas in another thread
(probably in language).

also there are configuration issues such as how small a BIGNUM can hold
any integer or float (for conversion allocations)?

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to