cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: vms_show hack explained

From: John E. Malmberg <wb8tyw_at_qsl.net>
Date: Thu, 14 Mar 2013 07:19:35 -0500

On 3/14/2013 6:51 AM, Yang Tse wrote:
> On Thu, Mar 14, 2013, John E. Malmberg <wb8tyw_at_qsl.net> wrote:
>
>> We just need to have the VMS specific wrapper to exit() handle everything.
>> If that a VMS specific wrapper is changed to be a macro in a VMS header
>> file, then this all can be hidden from the common Unix code.
>
> I'm absolutely baffled with some VMS changes that were introduced in
> 7.29.0, and I much fear that above quoted paragraph means even more in
> that direction. I'll explain myself and give you the reason for this
> (but please don't take this as something personal, I'm just speaking
> from a 'technical' point of view)...

I have reasons for all of them from a technical point of view. But in
some cases, it is more a case of what I have time to implement and test.

I am currently trying to get a number of vms ported projects up to date
and also document how and why to do things a certain way so that I can
get out of a fire-fighting mode.

> It mostly has to do with 7.29.0 implementation of what you are calling
> hiding VMS specifics in header files.
>
> In 7.29.0 lib/setup-vms.h declares and _implements_
> vms_translate_path(), vms_getenv() and vms_getpwuid() functions. This
> means that every single source file which directly or indirectly
> includes this header file will get a private implementation of these
> three functions. More specifically it means that _every_ single source
> file in libcurl's subdirectory, every single source file in curl tool
> subdirectory and also every single source file in tests subdirectory
> tree will have a private implementation of those functions when the
> source file is finally compiled.
>
> Unless the VMS linker is removing all private unused functions,
> libcurl and curl's size will have unnecessarily grown with 7.29.0

The VMS compiler removes all private unused functions. For small
functions it will also inline optimize them. On the IA64 processor,
that can result in a significant speedup, and it can also speed up the
Alpha processor.

The vms_translate_path() is not needed for newer versions of VMS greater
than 7.3. At this time, I do not know at what version I can
conditionally not compile it in, hence there is a test to see if a
translation needs to be done.

Basically on Alpha and IA64 calling a procedure has high overhead, so if
the procedure is only a few lines long, it is actually better to inline
it than to put it in an external function.

> At most, setup-vms.h should be defining C preprocessor macros and
> including system header files which shall be included in every single
> source file before other system headers are individually and
> conditionally included in each source file. And not being used to
> 'feed' function implementations into other source files.
>
> Notice also that, intentionally or not, any system header and any
> third party header file included after this one will be influenced by
> whatever is inside there. For some third party header adjustments this
> is exactly what is needed. But for each line that is included into
> setup-vms.h the chance of having to pull more and more system headers
> from within setup-vms.h increases and at a given point it will become
> broken and unmaintainable.

There are some VMS C library routines that do not function the way that
curl needs because of bugs in various versions of them.

Because of the way that the VMS C Compiler works, I first have to define
a macro to "hide" the routine, include the real header file, undo the
macro, and then undo the macro, and then define the macro routine.

There is more, but I am out of time a the moment.

> So please don't fit more function implementations into header files.
>
> For now, we should focus on making sure that 7.30.0 will build out of the box.
>
> BTW, did you miss? http://curl.haxx.se/mail/lib-2013-03/0160.html

No I did not, but I will not have time to respond for at least 8 to 10
hours from now as I have to run out the door now.

Regards,
-John
wb8tyw_at_qsl.net
Personal Opinion Only

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-14