Results of 1 - 10 of about 18 for sizeof (0.008 sec.)
- ctypes --- Python 用の外部関数ライブラリ 13932
- ctypes --- Python 用の外部関数ライブラリ ソースコード: Lib/ctypes ctypes は Python 用の外部関数ライブラリです。 C と互換性のあるデータ型を提供し、DLL や共有ライブラリの関数を呼び出せます。 これらのライブラリを純粋な Python でラップするために
...態を引き起こす可能性があります。 ctypes チュートリアル 注意: いくつかのコードサンプルで ctypes の c_int 型を参照しています。 sizeof(long) == sizeof(int) であるようなプラットフォームでは、この型は c_long のエイリアスです。そのため、 c_int 型を想定している...rom ctypes import * >>> p = create_string_buffer ( 3 ) # NUL バイトで初期化した 3 バイトのバッファを作成します >>> print ( sizeof ( p ), repr ( p . raw )) 3 b'\x00\x00\x00' >>> p = create_string_buffer ( b "Hello" ) # NUL 終端文字列を含むバッファを作成...します >>> print ( sizeof ( p ), repr ( p . raw )) 6 b'Hello\x00' >>> print ( repr ( p . value )) b'Hello' >>> p = create_string_buffer ( b "Hello"... - https://man.mtool.work/python/3.14/library/ctypes.html
- はじめに 10964
- はじめに Python のアプリケーションプログラマー向けインターフェース (API) は、C と C++ のプログラマーに、Python インタープリタへのさまざまなレベルのアクセスを提供します。 C++ からも同様に使えますが、簡潔に Python/C API と呼びます。 Python/C
...価できない場合は、ビルドに失敗します。 C23 以降では、おおむね static_assert( cond ) に相当します。 例えば: Py_BUILD_ASSERT ( sizeof ( PyTime_t ) == sizeof ( int64_t )); Added in version 3.3. Py_BUILD_ASSERT_EXPR ( cond ) コンパイル時の条件 cond をアサート...明な配列を渡すと、一部のコンパイラではコンパイルエラーになり、それ以外では誤った結果になります。 おおむね次の式と等価です。 sizeof ( array ) / sizeof (( array )[ 0 ]) Py_MEMBER_SIZE ( type , member ) 構造体 type のメンバー member のサイズをバイト数で返し...ます。 おおむね sizeof((( type *)NULL)-> member ) に相当します。 Added in version 3.6. マクロ定義のユーティリティ Py_FORCE_EXPANSION ( X ) X と等... - https://man.mtool.work/python/3.14/c-api/intro.html
- Expat C API 9968
- Expat C API The xml.parsers.expat module exposes selected Expat functions through its expat_CAPI capsule. This allows extension modules to use the same Expat library as Python. The interface is declared in pyexpat.h , which must be included
...in the structure, check that its magic member compares equal to this string using strcmp() and its size member is at least sizeof ( struct PyExpat_CAPI ) . struct PyExpat_CAPI Table of function pointers exported by xml.parsers.expat . The capsule owns...pat_CAPI_MAGIC before using the function pointers. char * magic Interface identifier, set to PyExpat_CAPI_MAGIC . int size Size of the structure in bytes, set to sizeof(struct PyExpat_CAPI) by the xml.parsers.expat module that created the capsule. int... - https://man.mtool.work/python/3.14/c-api/pyexpat.html
- 2. 拡張の型の定義: チュートリアル 9780
- 2. 拡張の型の定義: チュートリアル Python では、組み込みの str 型や list 型のような Python コードから操作できる新しい型を C 拡張モジュールの作者が定義できます。 全ての拡張の型のコードはあるパターンに従うのですが、書き始める前に理解しておくべ
...ject_HEAD_INIT ( NULL , 0 ) . tp_name = "custom.Custom" , . tp_doc = PyDoc_STR ( "Custom オブジェクト" ), . tp_basicsize = sizeof ( CustomObject ), . tp_itemsize = 0 , . tp_flags = Py_TPFLAGS_DEFAULT , . tp_new = PyType_GenericNew , }; static int custo...ject_HEAD_INIT ( NULL , 0 ) . tp_name = "custom.Custom" , . tp_doc = PyDoc_STR ( "Custom オブジェクト" ), . tp_basicsize = sizeof ( CustomObject ), . tp_itemsize = 0 , . tp_flags = Py_TPFLAGS_DEFAULT , . tp_new = PyType_GenericNew , }; 注釈 上にあるよう...oc や pickle モジュールと互換性のあるものにするには、実際のドット付きインポートパスを使うことが重要です。 . tp_basicsize = sizeof ( CustomObject ), . tp_itemsize = 0 , これは、新しい Custom インスタンスを作るときに Python が割り当てるべきメモリがどのく... - https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
- 型オブジェクトの構造体 9574
- 型オブジェクトの構造体 新しい型を定義する PyTypeObject 構造体は、Python のオブジェクトシステムで特に重要な構造体の 1 つです。 型オブジェクトは PyObject_* 関数や PyType_* 関数で扱えますが、ほとんどの Python アプリケーションにとって関心のある
...スタンスに必要な追加データのサイズを含めます。 tp_basicsize を正しく設定するには、インスタンスのレイアウトを宣言する構造体に sizeof 演算子を使います。 この構造体は、基底型を宣言する構造体を含んでいなければなりません。 つまり tp_basicsize は、基底型の tp_...に関する注意事項: tp_basicsize は _Alignof(PyObject) の倍数でなければなりません。 推奨どおり PyObject_HEAD を含む struct に sizeof を使えば、コンパイラがこれを保証します。 C の struct を使わない場合や、 __attribute__((packed)) などのコンパイラ拡張を使う...オブジェクトの ob_size フィールドを nitems に初期化し、割り当てるメモリブロックの長さは tp_basicsize + nitems*tp_itemsize を sizeof(void*) の倍数に切り上げた値にするべきです。 それ以外の場合、 nitems は使わず、ブロックの長さは tp_basicsize にするべきです... - https://man.mtool.work/python/3.14/c-api/typeobj.html
- platform --- 実行中プラットフォームの固有情報を参照する 9179
- platform --- 実行中プラットフォームの固有情報を参照する ソースコード: Lib/platform.py 注釈 プラットフォーム毎にアルファベット順に並べています。Linuxについては Unixセクションを参照してください。 プラットフォーム共通 platform. architecture (
...場合はパラメータプリセットから与えられる値を返します。bits に '' を与えた場合、サポートされているポインタサイズを知るために sizeof(pointer) (Python バージョン < 1.5.2 では sizeof(long) ) が使用されます。 この関数は、システムの file コマンドを使用します。...て、出力形式を明示的に制御することもできます。 これらの動作は、対応するオプションと同様です。 他のマニュアルの関連ページ PHP sizeof() Docker docker manifest Linux JM ld(1) PHP phpdbg_get_executable() PHP is_executable() Linux JM factor(1)... - https://man.mtool.work/python/3.14/library/platform.html
- メモリ管理 8390
- メモリ管理 概要 Python におけるメモリ管理には、全ての Python オブジェクトとデータ構造が入ったプライベートヒープ (private heap) が必須です。プライベートヒープの管理は、内部的には Python メモリマネージャ (Python memory manager) が確実に行いま
...のために提供されているものです。 TYPE は任意の C の型を表します。 PyMem_New ( TYPE , n ) PyMem_Malloc() と同じですが、 (n * sizeof(TYPE)) バイトのメモリを割り当て、 TYPE* にキャストしたポインタを返します。 メモリはいかなる方法でも初期化されません。 PyMe...m_Resize ( p , TYPE , n ) PyMem_Realloc() と同じですが、メモリブロックを (n * sizeof(TYPE)) バイトにリサイズし、 TYPE* にキャストしたポインタを返します。 戻ったときの p は、新しいメモリ領域へのポインタ、また...表示されるのは、 tracemalloc が Python のメモリ割り当てを追跡しており、そのブロックが追跡対象だった場合だけです。 Let S = sizeof(size_t) . 2*S bytes are added at each end of each block of N bytes requested. The memory layout is like so, where p repres... - https://man.mtool.work/python/3.14/c-api/memory.html
- 整数型オブジェクト (integer object) 7995
- 整数型オブジェクト (integer object) すべての整数は任意の長さをもつ "long" 整数として実装されます。 エラーが起きると、ほとんどの PyLong_As* API は (return type)-1 を返しますが、これは数値と見分けが付きません。 見分けを付けるためには PyErr_Oc
...常に 2 の補数表現でコピーします。 使用例です。 int32_t value ; Py_ssize_t bytes = PyLong_AsNativeBytes ( pylong , & value , sizeof ( value ), -1 ); if ( bytes < 0 ) { // 失敗。理由を示す Python の例外が設定されています。 return NULL ; } else if ( bytes...<= ( Py_ssize_t ) sizeof ( value )) { // 成功。 } else { // オーバーフローしましたが、'value' には切り詰めた // pylong の下位ビットが格納されていま...マクロです。 This can be defined as an alias to PyLong_AsLong() , PyLong_AsLongLong() , or PyLong_AsInt() , depending on the size of the system's PID type. Added in version 3.2. int PyLong_GetSign ( PyObject * obj , int * sign ) 整数オブジェクト obj の符... - https://man.mtool.work/python/3.14/c-api/long.html
- リモートデバッグのアタッチプロトコル 7807
- リモートデバッグのアタッチプロトコル このプロトコルを使うと、外部ツールから実行中の CPython プロセスにアタッチし、Python コードをリモートで実行できます。 別の Python プロセスへのアタッチには、プラットフォームによって追加の権限や設定が必要な
...バージョン番号とマイナーバージョン番号です。 PyRuntim セクションを探します。 PE 形式のセクション名には 8 文字の制限 ( IMAGE_SIZEOF_SHORT_NAME として定義) があるため、元の名前 PyRuntime は切り詰められます。 このセクションに PyRuntime 構造体があります。 セ...PyRuntime # section. The section name appears as "PyRuntim" due to the # 8-character limit defined by the PE format (IMAGE_SIZEOF_SHORT_NAME). section_rva = parse_pe_section_offset ( binary_path , "PyRuntim" ) # Step 4: Compute PyRuntime address in mem... - https://man.mtool.work/python/3.14/howto/remote_debugging.html
- sys --- システム固有のパラメーターと関数 7807
- sys --- システム固有のパラメーターと関数 このモジュールは、インタープリタが使用または管理する変数と、インタープリタに密接に関わる関数を提供します。 常に利用できます。 特に明記されていない限り、すべての変数は読み出し専用です。 sys. abiflags
...ローしてクラッシュすることを防止するために設けられています。この値は setrecursionlimit() で指定することができます。 sys. getsizeof ( object [ , default ] ) object のサイズをバイト数で返します。 object は任意の型のオブジェクトです。すべての組み込みオブジ...イズを取得する手段を提供していない時は default が返されます。 default が指定されていない場合は TypeError が送出されます。 getsizeof() はオブジェクトの __sizeof__ メソッドを呼び出します。 オブジェクトがガベージコレクタに管理されている場合は、ガベージコレク...タの管理に必要な追加のメモリ量を結果に加算します。 コンテナとその内容すべてのサイズを調べるために getsizeof() を再帰的に使う例は、 recursive sizeof recipe を参照してください。 sys. getswitchinterval ( ) インタープリタの「スレッド切... - https://man.mtool.work/python/3.14/library/sys.html