* source to VMS C RTL malloc()?
@ 1993-09-09 1:14 Jack Twilley
1993-09-09 8:36 ` Andreas Fassl
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jack Twilley @ 1993-09-09 1:14 UTC (permalink / raw)
I would be interested in seeing the source code to malloc() in
the VMS C run-time library.
How could this be done?
Jack.
--
John M. Twilley | nautilus@acm.rpi.edu | twilley@dewey.nl.nuwc.navy.mil
"Our passion is like a nuclear explosion: violent anticipation, a
brilliant blast of heat and light, and a beautiful sunset..." --me
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: source to VMS C RTL malloc()?
1993-09-09 1:14 source to VMS C RTL malloc()? Jack Twilley
@ 1993-09-09 8:36 ` Andreas Fassl
1993-09-09 9:14 ` Carl J Lydick
1993-09-10 2:06 ` Pat Rankin
2 siblings, 0 replies; 6+ messages in thread
From: Andreas Fassl @ 1993-09-09 8:36 UTC (permalink / raw)
In <TWILLEY.93Sep8211451@dewey.nl.nuwc.navy.mil> twilley@dewey.nl.nuwc.navy.mil (Jack Twilley) writes:
>I would be interested in seeing the source code to malloc() in
>the VMS C run-time library.
>
Hm, I'm sure you really don't WANT to see the source. :-)
BTW, I recommend to wait for the new DEC C-RTL, digital promised to have
fixed a lot of bugs (features) to be found in VAXCRTL.OLB.
andreas
--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ proGIS Softwareentwicklung, Simulationssysteme, Beratung +
+ Germany - 52064 Aachen, Jakobstrasse 181 +
+ E-Mail: andreas@didymus.rmi.de VOICE: (49) 241 403 446 +
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: source to VMS C RTL malloc()?
1993-09-09 1:14 source to VMS C RTL malloc()? Jack Twilley
1993-09-09 8:36 ` Andreas Fassl
@ 1993-09-09 9:14 ` Carl J Lydick
1993-09-10 9:56 ` Don Stokes
1993-09-10 2:06 ` Pat Rankin
2 siblings, 1 reply; 6+ messages in thread
From: Carl J Lydick @ 1993-09-09 9:14 UTC (permalink / raw)
In article <TWILLEY.93Sep8211451@dewey.nl.nuwc.navy.mil>, twilley@dewey.nl.nuwc.navy.mil (Jack Twilley) writes:
=I would be interested in seeing the source code to malloc() in
=the VMS C run-time library.
=
=How could this be done?
Well, it might be on the VMS listings (if you're paying for those). Otherwise,
you can get the assembly-language version by writing a program that calls
malloc(), compiling and linking it /DEBUG, and using the EXAMINE/INSTRUCTION
command from within the debugger. The latter's a rather tedious process,
though. I used it once to look at some of the string-handling routines in the
VAXC RTL.
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My
understanding of astronomy is purely at the amateur level (or below). So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it. If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: source to VMS C RTL malloc()?
1993-09-09 1:14 source to VMS C RTL malloc()? Jack Twilley
1993-09-09 8:36 ` Andreas Fassl
1993-09-09 9:14 ` Carl J Lydick
@ 1993-09-10 2:06 ` Pat Rankin
2 siblings, 0 replies; 6+ messages in thread
From: Pat Rankin @ 1993-09-10 2:06 UTC (permalink / raw)
In article <TWILLEY.93Sep8211451@dewey.nl.nuwc.navy.mil>,\
twilley@dewey.nl.nuwc.navy.mil (Jack Twilley) writes...
> I would be interested in seeing the source code to malloc() in
> the VMS C run-time library.
You can find MALLOC.LIS in [.CRTL.LIS] on the listings kit (available
in CD format; I don't think the microfiche version is available any more).
It basically just calls LIB$GET_VM, although it does keep track of the
most recently freed block and try to reuse that when possible. If you
allocate and free a huge number of items, you might notice performance
problems after freeing lots of them. The default behavior (for LIB$FREE_VM)
is to keep the free list sorted so that adjacent blocks can be coalesced
into bigger ones, but once that list grows long, the cost of traversing it
becomes very expensive in terms of CPU time and particularly page faults.
(We have a program which could do scores or hundreds of thousands of
allocations, then eventually free all of them, but not in the same order
they were allocated; it thrashed like crazy during its own rundown until
we switched to a substitute allocator.)
V6.0 (and 1.? for Alpha) introduces new LIB$VM_MALLOC and co., which
use different strategies for allocation and release and reportedly yield
significant improvements for some usage patterns. DECC$SHR's malloc calls
those routines instead of the LIB$GET_VM family.
Pat Rankin, rankin@eql.caltech.edu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: source to VMS C RTL malloc()?
1993-09-09 9:14 ` Carl J Lydick
@ 1993-09-10 9:56 ` Don Stokes
1993-09-11 0:07 ` Carl J Lydick
0 siblings, 1 reply; 6+ messages in thread
From: Don Stokes @ 1993-09-10 9:56 UTC (permalink / raw)
carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
> Well, it might be on the VMS listings (if you're paying for those). Otherwise,
> you can get the assembly-language version by writing a program that calls
> malloc(), compiling and linking it /DEBUG, and using the EXAMINE/INSTRUCTION
> command from within the debugger. The latter's a rather tedious process,
> though. I used it once to look at some of the string-handling routines in the
> VAXC RTL.
I presume this was followed by rewriting said routines?
<sigh> Life's too short to spend debugging VAXCRTL.
--
Don Stokes, CSC Network Manager, Victoria University of Wellington, New Zealand
Ph+64 4 495-5052 Fax+64 4 471-5386 Work:don@vuw.ac.nz Home:don@zl2tnm.gen.nz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: source to VMS C RTL malloc()?
1993-09-10 9:56 ` Don Stokes
@ 1993-09-11 0:07 ` Carl J Lydick
0 siblings, 0 replies; 6+ messages in thread
From: Carl J Lydick @ 1993-09-11 0:07 UTC (permalink / raw)
Apologies to those of you who received my previous response before I cancelled
it.
In article <640252@zl2tnm.gen.nz>, don@zl2tnm.gen.nz (Don Stokes) writes:
=carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
=> Well, it might be on the VMS listings (if you're paying for those). Otherwise,
=> you can get the assembly-language version by writing a program that calls
=> malloc(), compiling and linking it /DEBUG, and using the EXAMINE/INSTRUCTION
=> command from within the debugger. The latter's a rather tedious process,
=> though. I used it once to look at some of the string-handling routines in the
=> VAXC RTL.
=
=I presume this was followed by rewriting said routines?
=
=<sigh> Life's too short to spend debugging VAXCRTL.
Actually, no, it wasn't. When I did this, I found that the VAXC RTL used the
LIB$MOVCx library routines and associated routines. I'd been thinking of
writing my own library based on those routines, but the VAXC RTL already did
things the way I'd planned to.
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My
understanding of astronomy is purely at the amateur level (or below). So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it. If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1993-09-11 0:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-09-09 1:14 source to VMS C RTL malloc()? Jack Twilley
1993-09-09 8:36 ` Andreas Fassl
1993-09-09 9:14 ` Carl J Lydick
1993-09-10 9:56 ` Don Stokes
1993-09-11 0:07 ` Carl J Lydick
1993-09-10 2:06 ` Pat Rankin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox