Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
95e2a916
Kaydet (Commit)
95e2a916
authored
May 26, 2006
tarafından
Fredrik Lundh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use Py_LOCAL also for string and unicode objects
üst
df676c5f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
37 deletions
+18
-37
pyport.h
Include/pyport.h
+7
-2
stringobject.c
Objects/stringobject.c
+1
-13
unicodeobject.c
Objects/unicodeobject.c
+10
-22
No files found.
Include/pyport.h
Dosyayı görüntüle @
95e2a916
...
...
@@ -139,12 +139,17 @@ typedef Py_intptr_t Py_ssize_t;
/* PY_LOCAL can be used instead of static to get the fastest possible calling
* convention for functions that are local to a given module. It also enables
* inlining, where suitable. */
* inlining, where suitable.
*
* NOTE: You can only use this for functions that are entirely local to a
* module; functions that are exported via method tables, callbacks, etc,
* should keep using static.
*/
#undef USE_INLINE
/* XXX - set via configure? */
#if defined(_MSC_VER)
/* ignore warnings if the compiler decides not to inline a function */
/* ignore warnings if the compiler decides not to inline a function */
#pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
#define Py_LOCAL(type) static __inline type __fastcall
...
...
Objects/stringobject.c
Dosyayı görüntüle @
95e2a916
...
...
@@ -5,18 +5,6 @@
#include <ctype.h>
#undef USE_INLINE
/* XXX - set via configure? */
#if defined(_MSC_VER)
/* this is taken from _sre.c */
#pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
#define LOCAL(type) static __inline type __fastcall
#elif defined(USE_INLINE)
#define LOCAL(type) static inline type
#else
#define LOCAL(type) static type
#endif
#ifdef COUNT_ALLOCS
int
null_strings
,
one_strings
;
#endif
...
...
@@ -798,7 +786,7 @@ PyString_AsStringAndSize(register PyObject *obj,
#define FAST_COUNT 0
#define FAST_SEARCH 1
LOCAL
(
Py_ssize_t
)
Py_
LOCAL
(
Py_ssize_t
)
fastsearch
(
const
char
*
s
,
Py_ssize_t
n
,
const
char
*
p
,
Py_ssize_t
m
,
int
mode
)
{
long
mask
;
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
95e2a916
...
...
@@ -49,18 +49,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <windows.h>
#endif
#undef USE_INLINE
/* XXX - set via configure? */
#if defined(_MSC_VER)
/* this is taken from _sre.c */
#pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
#define LOCAL(type) static __inline type __fastcall
#elif defined(USE_INLINE)
#define LOCAL(type) static inline type
#else
#define LOCAL(type) static type
#endif
/* Limit for the Unicode object free list */
#define MAX_UNICODE_FREELIST_SIZE 1024
...
...
@@ -153,7 +141,7 @@ static BLOOM_MASK bloom_linebreak;
#define BLOOM_LINEBREAK(ch)\
(BLOOM(bloom_linebreak, (ch)) && Py_UNICODE_ISLINEBREAK((ch)))
LOCAL
(
BLOOM_MASK
)
make_bloom_mask
(
Py_UNICODE
*
ptr
,
Py_ssize_t
len
)
Py_
LOCAL
(
BLOOM_MASK
)
make_bloom_mask
(
Py_UNICODE
*
ptr
,
Py_ssize_t
len
)
{
/* calculate simple bloom-style bitmask for a given unicode string */
...
...
@@ -167,7 +155,7 @@ LOCAL(BLOOM_MASK) make_bloom_mask(Py_UNICODE* ptr, Py_ssize_t len)
return
mask
;
}
LOCAL
(
int
)
unicode_member
(
Py_UNICODE
chr
,
Py_UNICODE
*
set
,
Py_ssize_t
setlen
)
Py_
LOCAL
(
int
)
unicode_member
(
Py_UNICODE
chr
,
Py_UNICODE
*
set
,
Py_ssize_t
setlen
)
{
Py_ssize_t
i
;
...
...
@@ -2027,9 +2015,9 @@ onError:
*/
LOCAL
(
const
Py_UNICODE
*
)
findchar
(
const
Py_UNICODE
*
s
,
Py_ssize_t
size
,
Py_UNICODE
ch
)
Py_
LOCAL
(
const
Py_UNICODE
*
)
findchar
(
const
Py_UNICODE
*
s
,
Py_ssize_t
size
,
Py_UNICODE
ch
)
{
/* like wcschr, but doesn't stop at NULL characters */
...
...
@@ -3880,7 +3868,7 @@ int PyUnicode_EncodeDecimal(Py_UNICODE *s,
#define FAST_COUNT 0
#define FAST_SEARCH 1
LOCAL
(
Py_ssize_t
)
Py_
LOCAL
(
Py_ssize_t
)
fastsearch
(
Py_UNICODE
*
s
,
Py_ssize_t
n
,
Py_UNICODE
*
p
,
Py_ssize_t
m
,
int
mode
)
{
long
mask
;
...
...
@@ -3955,10 +3943,10 @@ fastsearch(Py_UNICODE* s, Py_ssize_t n, Py_UNICODE* p, Py_ssize_t m, int mode)
return
count
;
}
LOCAL
(
Py_ssize_t
)
count
(
PyUnicodeObject
*
self
,
Py_ssize_t
start
,
Py_ssize_t
end
,
PyUnicodeObject
*
substring
)
Py_
LOCAL
(
Py_ssize_t
)
count
(
PyUnicodeObject
*
self
,
Py_ssize_t
start
,
Py_ssize_t
end
,
PyUnicodeObject
*
substring
)
{
Py_ssize_t
count
=
0
;
...
...
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