Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
f82ea195
Commit
f82ea195
authored
Aug 20, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exclude comments from generated C file
parent
7551bd22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
24 deletions
+17
-24
Cython/Utility/arrayarray.h
Cython/Utility/arrayarray.h
+17
-24
No files found.
Cython/Utility/arrayarray.h
View file @
f82ea195
/////////////// ArrayAPI.proto ///////////////
/* arrayarray.h
Artificial C-API for Python's <array.array> type,
used by array.pxd
last changes: 2009-05-15 rk
2012-05-02 andreasvc
(see revision control)
*/
// arrayarray.h
//
// Artificial C-API for Python's <array.array> type,
// used by array.pxd
//
// last changes: 2009-05-15 rk
// 2012-05-02 andreasvc
// (see revision control)
//
#ifndef _ARRAYARRAY_H
#define _ARRAYARRAY_H
struct
arrayobject
;
/* Forward */
/* All possible arraydescr values are defined in the vector "descriptors"
* below. That's defined later because the appropriate get and set
* functions aren't visible yet.
*/
// All possible arraydescr values are defined in the vector "descriptors"
// below. That's defined later because the appropriate get and set
// functions aren't visible yet.
typedef
struct
arraydescr
{
int
typecode
;
int
itemsize
;
...
...
@@ -66,11 +64,7 @@ typedef struct arrayobject {
#ifndef NO_NEWARRAY_INLINE
/*
*
* fast creation of a new array
*/
// fast creation of a new array
static
CYTHON_INLINE
PyObject
*
newarrayobject
(
PyTypeObject
*
type
,
Py_ssize_t
size
,
struct
arraydescr
*
descr
)
{
arrayobject
*
op
;
...
...
@@ -113,8 +107,8 @@ PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
struct
arraydescr
*
descr
);
#endif
/* ifndef NO_NEWARRAY_INLINE */
/
* fast resize (reallocation to the point)
not designed for filing small increments (but for fast opaque array apps) */
/
/ fast resize (reallocation to the point)
// not designed for filing small increments (but for fast opaque array apps)
static
int
resize
(
arrayobject
*
self
,
Py_ssize_t
n
)
{
void
*
item
=
(
void
*
)
self
->
ob_item
;
PyMem_Resize
(
item
,
char
,
(
size_t
)(
n
*
self
->
ob_descr
->
itemsize
));
...
...
@@ -130,8 +124,8 @@ static int resize(arrayobject *self, Py_ssize_t n) {
return
0
;
}
/
*
suitable for small increments; over allocation 50% ;
Remains non-smart in Python 2.3- ; but exists for compatibility */
/
/
suitable for small increments; over allocation 50% ;
// Remains non-smart in Python 2.3- ; but exists for compatibility
static
int
resize_smart
(
arrayobject
*
self
,
Py_ssize_t
n
)
{
#if PY_VERSION_HEX >= 0x02040000
void
*
item
=
(
void
*
)
self
->
ob_item
;
...
...
@@ -157,6 +151,5 @@ static int resize_smart(arrayobject *self, Py_ssize_t n) {
#endif
}
#endif
/* _ARRAYARRAY_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment