提交 8691ff97 编写于 作者: A Andy Polyakov

Move primes to read-only segment.

上级 bd445703
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#else #else
#define NUMPRIMES 54 #define NUMPRIMES 54
#endif #endif
static unsigned int primes[NUMPRIMES]= static const unsigned int primes[NUMPRIMES]=
{ {
2, 3, 5, 7, 11, 13, 17, 19, 2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53, 23, 29, 31, 37, 41, 43, 47, 53,
......
...@@ -104,7 +104,7 @@ printf "#define NUMPRIMES %d\n",$num; ...@@ -104,7 +104,7 @@ printf "#define NUMPRIMES %d\n",$num;
printf "#else\n"; printf "#else\n";
printf "#define NUMPRIMES %d\n",$eight; printf "#define NUMPRIMES %d\n",$eight;
printf "#endif\n"; printf "#endif\n";
print "static unsigned int primes[NUMPRIMES]=\n\t{\n\t"; print "static const unsigned int primes[NUMPRIMES]=\n\t{\n\t";
$init=0; $init=0;
for ($i=0; $i <= $#primes; $i++) for ($i=0; $i <= $#primes; $i++)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册