mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
o Update to 1.3
- Includes support for Python 2.4 - Fix a memory leak when using the profiler - Built-in functions that read the local variables -- locals(), eval(), execfile(), vars(), dir(), input() -- now work correctly Approved by: maintainer (2 weeks timeout)
This commit is contained in:
parent
64dead4601
commit
b908acd9c8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=125049
@ -6,8 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= psyco
|
||||
PORTVERSION= 1.2
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 1.3
|
||||
CATEGORIES= devel python
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= psyco
|
||||
@ -24,4 +23,8 @@ USE_PYDISTUTILS=yes
|
||||
|
||||
WRKSRC= ${WRKDIR}/psyco-${PORTVERSION}
|
||||
|
||||
post-install:
|
||||
# fix installation permissions
|
||||
@${CHMOD} ${SHAREMODE} ${PYTHON_SITELIBDIR}/psyco/*
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,2 +1,2 @@
|
||||
MD5 (psyco-1.2-src.tar.gz) = 441bfc7693bf13902a479550dcbaabd2
|
||||
SIZE (psyco-1.2-src.tar.gz) = 318472
|
||||
MD5 (psyco-1.3-src.tar.gz) = ef2dd14e933c40b420693d0cf5bb2aff
|
||||
SIZE (psyco-1.3-src.tar.gz) = 1099318
|
||||
|
@ -1,85 +0,0 @@
|
||||
--- c/codemanager.c.orig Tue Dec 2 17:46:39 2003
|
||||
+++ c/codemanager.c Sun Aug 1 08:41:16 2004
|
||||
@@ -2,21 +2,12 @@
|
||||
#include <ipyencoding.h>
|
||||
|
||||
/*** Allocators for Large Executable Blocks of Memory ***/
|
||||
-/* Defaults, possibly overridden below */
|
||||
-#define LEBM_WITH_MMAP 0 /* assume memory executable by default */
|
||||
-#define LEBM_NUM_BIGBLOCKS 1 /* not too large blocks */
|
||||
|
||||
#ifndef MS_WINDOWS
|
||||
/* Assume UNIX */
|
||||
# include <sys/mman.h>
|
||||
-# if defined(MAP_ANONYMOUS) || defined(MAP_ANON)
|
||||
-# undef LEBM_WITH_MMAP
|
||||
-# undef LEBM_NUM_BIGBLOCKS
|
||||
-# define LEBM_WITH_MMAP 1 /* use mmap() with PROT_EXEC */
|
||||
-# define LEBM_NUM_BIGBLOCKS 32 /* ask for 32MB at a time */
|
||||
-# ifndef MAP_ANONYMOUS
|
||||
-# define MAP_ANONYMOUS MAP_ANON
|
||||
-# endif
|
||||
+# if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
||||
+# define MAP_ANONYMOUS MAP_ANON
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -42,22 +33,44 @@
|
||||
|
||||
static void allocate_more_buffers(codemanager_buf_t** bb)
|
||||
{
|
||||
- char* p;
|
||||
- int i;
|
||||
-
|
||||
-#if LEBM_WITH_MMAP
|
||||
- p = (char*) mmap(NULL, BIG_BUFFER_SIZE * LEBM_NUM_BIGBLOCKS,
|
||||
- PROT_EXEC|PROT_READ|PROT_WRITE,
|
||||
- MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
|
||||
- if (p == MAP_FAILED)
|
||||
- OUT_OF_MEMORY();
|
||||
-#else
|
||||
- p = (char*) PyMem_MALLOC(BIG_BUFFER_SIZE * LEBM_NUM_BIGBLOCKS);
|
||||
- if (!p)
|
||||
- OUT_OF_MEMORY();
|
||||
+ char* p = NULL;
|
||||
+ int num_bigblocks = 1;
|
||||
+
|
||||
+#if defined(MAP_ANONYMOUS) && defined(MAP_PRIVATE)
|
||||
+ /* if we have anonymous mmap's, try using that -- this is known
|
||||
+ to fail on some platforms */
|
||||
+ static int mmap_works = -1;
|
||||
+ if (mmap_works != 0)
|
||||
+ {
|
||||
+ num_bigblocks = 32; /* allocate 32MB at a time */
|
||||
+ p = (char*) mmap(NULL, BIG_BUFFER_SIZE * num_bigblocks,
|
||||
+ PROT_EXEC|PROT_READ|PROT_WRITE,
|
||||
+ MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
||||
+ if (p == MAP_FAILED || p == NULL)
|
||||
+ {
|
||||
+ if (mmap_works == 1)
|
||||
+ OUT_OF_MEMORY();
|
||||
+ mmap_works = 0; /* doesn't work */
|
||||
+ p = NULL;
|
||||
+ num_bigblocks = 1;
|
||||
+ /* note that some platforms *require* the allocation to be performed
|
||||
+ by mmap, because PyMem_MALLOC() doesn't set the PROT_EXEC flag.
|
||||
+ On these platforms we just hope that the first allocation is
|
||||
+ successful, which sets mmap_works to 1; a failure in a subsequent
|
||||
+ allocation correctly signals the OUT_OF_MEMORY. */
|
||||
+ }
|
||||
+ else
|
||||
+ mmap_works = 1;
|
||||
+ }
|
||||
#endif
|
||||
|
||||
- for (i=0; i<LEBM_NUM_BIGBLOCKS; i++)
|
||||
+ if (p == NULL)
|
||||
+ {
|
||||
+ p = (char*) PyMem_MALLOC(BIG_BUFFER_SIZE);
|
||||
+ if (p == NULL)
|
||||
+ OUT_OF_MEMORY();
|
||||
+ }
|
||||
+ while (--num_bigblocks >= 0)
|
||||
{
|
||||
/* the codemanager_buf_t structure is put at the end of the buffer,
|
||||
with its signature to detect overflows (just in case) */
|
Loading…
Reference in New Issue
Block a user