@@ -24,7 +24,7 @@ import_librt_strings(void)
2424
2525// Number of functions in the capsule API. If you add a new function, also increase
2626// LIBRT_STRINGS_API_VERSION.
27- #define LIBRT_STRINGS_API_LEN 9
27+ #define LIBRT_STRINGS_API_LEN 8
2828
2929static void * LibRTStrings_API [LIBRT_STRINGS_API_LEN ];
3030
@@ -46,8 +46,7 @@ typedef struct {
4646#define LibRTStrings_BytesWriter_append_internal (*(char (*)(PyObject *source, uint8_t value)) LibRTStrings_API[4])
4747#define LibRTStrings_ByteWriter_grow_buffer_internal (*(bool (*)(BytesWriterObject *obj, Py_ssize_t size)) LibRTStrings_API[5])
4848#define LibRTStrings_BytesWriter_type_internal (*(PyTypeObject* (*)(void)) LibRTStrings_API[6])
49- #define LibRTStrings_BytesWriter_len_internal (*(CPyTagged (*)(PyObject *self)) LibRTStrings_API[7])
50- #define LibRTStrings_BytesWriter_truncate_internal (*(char (*)(PyObject *self, int64_t size)) LibRTStrings_API[8])
49+ #define LibRTStrings_BytesWriter_truncate_internal (*(char (*)(PyObject *self, int64_t size)) LibRTStrings_API[7])
5150
5251static int
5352import_librt_strings (void )
@@ -134,6 +133,12 @@ CPyBytesWriter_Write(PyObject *obj, PyObject *value) {
134133 return CPY_NONE ;
135134}
136135
136+ static inline CPyTagged
137+ CPyBytesWriter_Len (PyObject * obj ) {
138+ BytesWriterObject * self = (BytesWriterObject * )obj ;
139+ return (CPyTagged )self -> len << 1 ;
140+ }
141+
137142#endif // MYPYC_EXPERIMENTAL
138143
139144#endif // LIBRT_STRINGS_H
0 commit comments