On 2011/9/20 Thomas Paviot wrote:
> 2011/9/20 D. Barbier wrote
[...]
>> but get now a segmentation fault:
>>  testHash (wrapper_features_unittest.TestWrapperFeatures) ... Test:
>> __hash__ overloading
>>  Segmentation fault
>>
>> More precisely:
>>  $ python
>>  Python 2.6.7 (r267:88850, Aug  3 2011, 11:33:52)
>>  [GCC 4.6.1] on linux2
>>  Type "help", "copyright", "credits" or "license" for more information.
>>  >>> import OCC.Standard
>>  >>> s = OCC.Standard.Standard_Transient()
>>  >>> hash1_s = s.__hash__()
>>  >>> hash2_s = s.HashCode(pow(2,31)-1)
>>  Segmentation fault
[...]
> When compiling pythonocc, you must pass -D__PYTHONOCCOCC_MAXINT__ integer.
> It's equal to 2^32-1 on 32bit platforms, 2^64-1 on 64bit. This is computed
> from the file environment.py
> (https://github.com/tpaviot/pythonocc/blob/master/src/wrapper/environment.py)
> called when compiling pythonocc from the setup.py script.

Hmmm, I am confused, this is hardcoded to 2^31-1 for 32 and 64 bits:

  # Define HASHCODE_MAXINT. Even on 64 bits systems, HashCode method
require a 32 bits Standard_Integer
  #
  HASHCODE_MAXINT = pow(2,31)-1

Denis

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to