[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] counting allocated bytes
From: |
Stephen Wilson |
Subject: |
[Gcl-devel] counting allocated bytes |
Date: |
10 Jul 2007 20:58:38 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Hello,
I have been working on evaluating/integrating a Lisp based testing
framework into Axiom (based on Lift). One of the features is the
ability to benchmark the running of tests.
To accommodate the benchmark code, I needed a function which returns
the total number of bytes allocated since the image was started.
I could not find such a function. Perhaps I missed it? There is
SI:ALLOCATED, but it reports information for a specific type only.
I considered writing a function using SI:ALLOCATED and SI:SIZE-OF for
personal use. However, when I considered if such a function would be
of use to GCL, I realized it may be better to attempt it in C.
Of course, if the facility already exists, then this is just a
learning experience for me. Attached is a patch against alloc.c.
I have two issues with this code:
* Is it correct to assume that all entries in tm_table with the
tm_size field equal share the same allocation space? I assumed
this from the documentation for SI:ALLOCATED.
* Im slightly concerned about overflow of the `bytes' variable. Is
this likely? Should bignum arith be used?
Hopefully this might be of some use to GCL, however I completely
understand if it is deemed unnecessary, badly implemented, etc.
Sincerely,
Steve
alloc.c.patch
Description: Text Data
- [Gcl-devel] counting allocated bytes,
Stephen Wilson <=