/tags/rel-1-3-29/SWIG/Examples/test-suite/python/li_cmalloc_runme.py

# · Python · 14 lines · 11 code · 3 blank · 0 comment · 2 complexity · 6b3b32a47b72d7ce96b0320b336a22d1 MD5 · raw file

  1. from li_cmalloc import *
  2. p = malloc_int()
  3. free_int(p)
  4. ok = 0
  5. try:
  6. p = calloc_int(-1)
  7. free_int(p)
  8. except:
  9. ok = 1
  10. if ok != 1:
  11. raise RuntimeError