@@ -283,7 +283,7 @@ int mmap_getbuffer(PyObject *self, Py_buffer *view, int flags) {
283283 return PyBuffer_FillInfo (view , (PyObject * )self , data , PyObject_Size ((PyObject * )self ), 0 , flags );
284284}
285285
286- PyAPI_FUNC ( void ) GraalPyPrivate_MMap_InitBufferProtocol (PyObject * mmap_type ) {
286+ GraalPy_CAPI_HELPER_SYMBOL void GraalPyPrivate_MMap_InitBufferProtocol (PyObject * mmap_type ) {
287287 GraalPyPrivate_Log (GRAALPY_LOG_FINE , "GraalPyPrivate_MMap_InitBufferProtocol" );
288288 assert (PyType_Check (mmap_type ));
289289
@@ -310,7 +310,7 @@ PyObject* _Py_NotImplementedStructReference;
310310 */
311311THREAD_LOCAL PyThreadState * tstate_current = NULL ;
312312
313- PyAPI_FUNC ( PyThreadState * * ) GraalPyPrivate_InitThreadStateCurrent (PyThreadState * tstate ) {
313+ GraalPy_CAPI_HELPER_SYMBOL PyThreadState * * GraalPyPrivate_InitThreadStateCurrent (PyThreadState * tstate ) {
314314 tstate_current = tstate ;
315315 return & tstate_current ;
316316}
@@ -446,7 +446,7 @@ GraalPyPrivate_SUBREF(intptr_t ptr, Py_ssize_t value)
446446}
447447
448448/** to be used from Java code only; calls '_Py_Dealloc' */
449- PyAPI_FUNC ( Py_ssize_t )
449+ GraalPy_CAPI_HELPER_SYMBOL Py_ssize_t
450450GraalPyPrivate_BulkDealloc (intptr_t ptrArray [], int64_t len )
451451{
452452 for (int i = 0 ; i < len ; i ++ ) {
@@ -460,7 +460,7 @@ GraalPyPrivate_BulkDealloc(intptr_t ptrArray[], int64_t len)
460460}
461461
462462/** to be used from Java code only and only at exit; calls _Py_Dealloc */
463- PyAPI_FUNC ( Py_ssize_t )
463+ GraalPy_CAPI_HELPER_SYMBOL Py_ssize_t
464464GraalPyPrivate_BulkDeallocOnShutdown (intptr_t ptrArray [], int64_t len )
465465{
466466 /* some objects depends on others which might get deallocated in the
@@ -487,11 +487,11 @@ GraalPyPrivate_BulkDeallocOnShutdown(intptr_t ptrArray[], int64_t len)
487487/* To be used from Java code only.
488488 * This function is used if a native class inherits from a managed class but uses the 'object.__new__'.
489489 * This function roughly corresponds to CPython's 'object_new'. */
490- PyAPI_FUNC ( PyObject * ) GraalPyPrivate_ObjectNew (PyTypeObject * cls ) {
490+ GraalPy_CAPI_HELPER_SYMBOL PyObject * GraalPyPrivate_ObjectNew (PyTypeObject * cls ) {
491491 return cls -> tp_alloc (cls , 0 );
492492}
493493
494- PyAPI_FUNC ( void ) GraalPyPrivate_ObjectArrayRelease (PyObject * * array , int32_t size ) {
494+ GraalPy_CAPI_HELPER_SYMBOL void GraalPyPrivate_ObjectArrayRelease (PyObject * * array , int32_t size ) {
495495 for (int i = 0 ; i < size ; i ++ ) {
496496 /* This needs to use 'Py_XDECREF' because we use this function to
497497 deallocate storages of tuples, lists, ..., where this is done in the
@@ -509,7 +509,7 @@ PyAPI_FUNC(void) GraalPyPrivate_ObjectArrayRelease(PyObject** array, int32_t siz
509509#include "psapi.h"
510510#endif
511511
512- PyAPI_FUNC ( size_t ) GraalPyPrivate_GetCurrentRSS () {
512+ GraalPy_CAPI_HELPER_SYMBOL size_t GraalPyPrivate_GetCurrentRSS (void ) {
513513 size_t rss = 0 ;
514514#if defined(__APPLE__ ) && defined(__MACH__ )
515515 // MacOS
@@ -541,7 +541,7 @@ PyAPI_FUNC(size_t) GraalPyPrivate_GetCurrentRSS() {
541541
542542
543543// Implements the basesisze check in typeobject.c:_PyObject_GetState
544- PyAPI_FUNC ( int ) GraalPyPrivate_CheckBasicsizeForGetstate (PyTypeObject * type , int slot_num ) {
544+ GraalPy_CAPI_HELPER_SYMBOL int GraalPyPrivate_CheckBasicsizeForGetstate (PyTypeObject * type , int slot_num ) {
545545 Py_ssize_t basicsize = PyBaseObject_Type .tp_basicsize ;
546546 if (type -> tp_dictoffset )
547547 basicsize += sizeof (PyObject * );
@@ -552,17 +552,17 @@ PyAPI_FUNC(int) GraalPyPrivate_CheckBasicsizeForGetstate(PyTypeObject* type, int
552552 return type -> tp_basicsize > basicsize ;
553553}
554554
555- PyAPI_FUNC ( void ) GraalPyPrivate_CheckTypeReady (PyTypeObject * type ) {
555+ GraalPy_CAPI_HELPER_SYMBOL void GraalPyPrivate_CheckTypeReady (PyTypeObject * type ) {
556556 if (!(type -> tp_flags & Py_TPFLAGS_READY )) {
557557 PyType_Ready (type );
558558 }
559559}
560560
561- PyAPI_FUNC ( int ) GraalPyPrivate_NoOpClear (PyObject * o ) {
561+ GraalPy_CAPI_HELPER_SYMBOL int GraalPyPrivate_NoOpClear (PyObject * o ) {
562562 return 0 ;
563563}
564564
565- PyAPI_FUNC ( int ) GraalPyPrivate_NoOpTraverse (PyObject * self , visitproc visit , void * arg ) {
565+ GraalPy_CAPI_HELPER_SYMBOL int GraalPyPrivate_NoOpTraverse (PyObject * self , visitproc visit , void * arg ) {
566566 return 0 ;
567567}
568568
@@ -646,7 +646,7 @@ PyAPI_FUNC(PyThreadState **) initialize_graal_capi(void **builtin_closures, GCSt
646646 * This function is called from Java during C API initialization to get the
647647 * pointer `_graalpy_finalizing`.
648648 */
649- PyAPI_FUNC ( int8_t * ) GraalPyPrivate_GetFinalizeCApiPointer () {
649+ GraalPy_CAPI_HELPER_SYMBOL void * GraalPyPrivate_GetFinalizeCApiPointer (void ) {
650650 assert (!_graalpy_finalizing );
651651 // We actually leak this memory on purpose. On the Java side, this is
652652 // written to in a VM shutdown hook. Once such a hook is registered it
0 commit comments