source: sage/ext/stdsage.pxi @ 5804:3dcce6f79ec6

Revision 5804:3dcce6f79ec6, 1.6 KB checked in by Robert Bradshaw <robertwb@…>, 6 years ago (diff)

remove all (memory-leaking) uses of FAST_SEQ_UNSAFE

Now that we have fast list/tuple indexing, it is hardly any gain,
and it was an irrecoverable memory leak.

Line 
1"""
2Standard SAGE Pyrex Helper Code
3"""
4
5################################################################################
6# stdsage.pxi
7#   Standard useful stuff for SAGE modules to include:
8#   See stdsage.h for macros and stdsage.c for C functions.
9#
10#   Each module currently gets its own copy of this, which is why
11#   we call the initialization code below.
12#
13################################################################################
14
15###############################################################################
16#   SAGE: System for Algebra and Geometry Experimentation   
17#       Copyright (C) 2005, 2006 William Stein <wstein@gmail.com>
18#  Distributed under the terms of the GNU General Public License (GPL)
19#  The full text of the GPL is available at:
20#                  http://www.gnu.org/licenses/
21###############################################################################
22
23cdef extern from "stdsage.h":
24    ctypedef void PyObject
25   
26    # Global tuple -- useful optimization
27    void init_global_empty_tuple()
28    object PY_NEW(object t)
29    void* PY_TYPE(object o)
30    bint PY_TYPE_CHECK(object o, object t)
31    object IS_INSTANCE(object o, object t)
32    void PY_SET_TP_NEW(object t1, object t2)
33    bint HAS_DICTIONARY(object o)
34    bint PY_IS_NUMERIC(object o)
35   
36
37# Memory management
38cdef extern from "stdlib.h":
39    ctypedef unsigned long size_t
40
41cdef extern from "stdsage.h":
42    void  sage_free(void *p)
43    void* sage_realloc(void *p, size_t n)
44    void* sage_malloc(size_t)
45    void  init_csage()
46
47
48# Do this for every single module that links in stdsage.
49# This is necessary on some platforms, e.g., Cygwin, so
50# do not delete it!
51init_csage()
52
Note: See TracBrowser for help on using the repository browser.