Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zlib_into
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dataAnalysis
zlib_into
Commits
80a19067
Commit
80a19067
authored
1 month ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Switch back to PyMem_Raw functions for zlib to allocate & free memory
parent
71e08ca8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Build for each Python version rather than using limited API
Pipeline
#164582
passed
1 month ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zlib_into.c
+2
-6
2 additions, 6 deletions
src/zlib_into.c
with
2 additions
and
6 deletions
src/zlib_into.c
+
2
−
6
View file @
80a19067
...
@@ -20,17 +20,13 @@ PyZlib_Malloc(voidpf ctx, uInt items, uInt size)
...
@@ -20,17 +20,13 @@ PyZlib_Malloc(voidpf ctx, uInt items, uInt size)
return
NULL
;
return
NULL
;
/* PyMem_Malloc() cannot be used: the GIL is not held when
/* PyMem_Malloc() cannot be used: the GIL is not held when
inflate() and deflate() are called */
inflate() and deflate() are called */
/* The builtin zlib module uses PyMem_RawMalloc here, but this was only
return
PyMem_RawMalloc
((
size_t
)
items
*
(
size_t
)
size
);
added to the stable ABI from Python 3.13, so use plain malloc for now */
return
malloc
((
size_t
)
items
*
(
size_t
)
size
);
}
}
static
void
static
void
PyZlib_Free
(
voidpf
ctx
,
void
*
ptr
)
PyZlib_Free
(
voidpf
ctx
,
void
*
ptr
)
{
{
/* The builtin zlib module uses PyMem_RawFree here, but this was only
PyMem_RawFree
(
ptr
);
added to the stable ABI from Python 3.13, so use plain free for now */
free
(
ptr
);
}
}
// zlib_error copied from CPython
// zlib_error copied from CPython
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment