Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH 00/11] pragma once: treewide conversion | Date | Thu, 4 Mar 2021 13:55:12 +0000 |
| |
> (a) the traditional include guard optimization HAS NO HIDDEN SEMANTIC > MEANING. It's a pure optimization that doesn't actually change > anything else. If you don't do the optimization, absolutely nothing > changes.
And if the parser is well written the optimisation is probably irrelevant compared to the compile time.
OTOH that probably requires using mmap(), memchr('\n') to look for line starts, a fast search for '[ ]*#' followed by else/endif and a final horrid backwards check for a continuation line.
That optimisation will generally speed up header file processing.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |