[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sig2str and str2sig use in C++

From: Paul Eggert
Subject: Re: sig2str and str2sig use in C++
Date: Mon, 03 Jun 2013 15:28:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

How about the following idea instead?
Have sig2str.h export an array like this:

extern char const allsigstr[];

This would consist of a concatenation of null-terminated strings,
one per name, terminated by an empty string.

allsigstr could be initialized at compile-time, with no runtime
actions needed.  Since it's read-only and initialized it could be put into
the text segment.

The existing numname_table could remove its 'name' field,
and replace it with an integer offset into allsigstr.  This
offset could also be calculated at compile-time, so
numname_table could live in the text segment too.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]