Thread View: gnu.g++
1 messages
1 total messages
Started by Michael Tiemann
Thu, 21 Sep 1989 03:21
Shorter names
Author: Michael Tiemann
Date: Thu, 21 Sep 1989 03:21
Date: Thu, 21 Sep 1989 03:21
32 lines
1723 bytes
1723 bytes
In an effort to generate shorter mangled names, here is something compilers can do, but only if all compilers that must interoperate adopt the convention. There seem to be a number of names which are almost always found being used in C++ programs: Integer, String, Object, etc. We could build a dictionary of all classnames that are found in existing implementations, sorted by apparent frequency of usage, and then these names could be refered to by their index in the dictionary. Suppose that `ostream' is index 2 and `Integer' is index number 10. Then the function ostream& Integer::PrintOn(ostream&) would be mangled as PrintOn__D10D2 instead of PrintOn__7Integer7ostream This has the problem of adding significant state to an implementation definition of a C++ compiler, so one might want to limit it to say the 100 most common class names. It would not be hard to implement: using Doug Schmidt's `gperf' program, a perfect hashing function could be used to generate code that all C++ compiler implementors could use for efficient lookup and consistent name-index associations, and the code for the function could be published as a standard. I am not proposing that this be done immediately, but it might be something to think about. Michael
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads