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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
f8858731
Commit
f8858731
authored
May 10, 2019
by
gsamain
Committed by
Xavier Thompson
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't generate default cypclass __alloc__ when user provides it
parent
626c5b0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+4
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
f8858731
...
...
@@ -1119,7 +1119,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"%s(){}"
%
type
.
cname
)
code
.
putln
(
"// Generating __alloc__ function (used for __new__ calls)"
)
alloc_entry
=
scope
.
lookup_here
(
"<alloc>"
)
code
.
putln
(
"static %s { return new %s(); }"
%
(
alloc_entry
.
type
.
declaration_code
(
alloc_entry
.
cname
),
type
.
declaration_code
(
""
,
deref
=
1
)))
if
alloc_entry
.
is_builtin_cmethod
:
code
.
putln
(
"static %s { return new %s(); }"
%
(
alloc_entry
.
type
.
declaration_code
(
alloc_entry
.
cname
),
type
.
declaration_code
(
""
,
deref
=
1
)))
code
.
putln
(
"};"
)
if
type
.
is_cyp_class
:
...
...
Cython/Compiler/Symtab.py
View file @
f8858731
...
...
@@ -699,7 +699,11 @@ class Scope(object):
alloc_name
=
"<alloc>"
alloc_entry
=
scope
.
declare
(
alloc_name
,
alloc_cname
,
alloc_type
,
pos
,
visibility
)
alloc_type
.
entry
=
alloc_entry
alloc_entry
.
is_inherited
=
1
alloc_entry
.
is_cfunction
=
1
# is_builtin_cmethod is currently only used in cclass, so it should be safe
# to use it here to distinguish between implicit default __alloc__ and user-defined one
alloc_entry
.
is_builtin_cmethod
=
1
alloc_entry
.
func_cname
=
"%s::%s"
%
(
entry
.
type
.
empty_declaration_code
(),
alloc_cname
)
if
self
.
is_cpp_class_scope
:
...
...
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