PageRenderTime 1555ms CodeModel.GetById 69ms RepoModel.GetById 32ms app.codeStats 1ms

/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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  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