Using vec with very large strings

X

xhoster

I'm trying to use a large bitmap, using vec. It seems that vec limits
itself to (signed) 32 bit integers as the index, even though I am on a 64
bit machine and use64bitall=define.

This is perl, v5.10.0 built for x86_64-linux-thread-multi

$ perl -le '(vec $x, (2**31), 1)=1;'
Negative offset to vec in lvalue context at -e line 1.

Is there some magic flag I can set and recompile to get 64-bit indexes for
vec?

Thanks,

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
U

Uri Guttman

x> I'm trying to use a large bitmap, using vec. It seems that vec limits
x> itself to (signed) 32 bit integers as the index, even though I am on a 64
x> bit machine and use64bitall=define.

x> This is perl, v5.10.0 built for x86_64-linux-thread-multi

x> $ perl -le '(vec $x, (2**31), 1)=1;'
x> Negative offset to vec in lvalue context at -e line 1.

x> Is there some magic flag I can set and recompile to get 64-bit
x> indexes for vec?

a clunky workaround would be to keep a longer string. then take take the
index and mod/divide it by 2**32 (or shift and mask) and lookup the
2**32 bit substring with substr (lvalue) and then vec that. it is only a
couple of lines of extra code. an array of 2**32 bit strings would work
too.

you may need to use 2**31 bits instead to skip the negative index
problem.

uri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top