- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to redefine memory allocation functions for MKL by using function pointer i_malloc and friends as described in https://software.intel.com/en-us/node/528395. On 32bit Windows however I am facing a problem: I could not figure out what is the calling convention for those functions? Is it __cdecl, __stdcall, __fastcall? The i_malloc.h header just says
typedef void * (* i_malloc_t)(size_t size);
But depending on whether I set -Gz for compilation or not this may change the calling convention on this function. Am I missing something here or should the header explicitly specify the calling convention?
Anyway, what actually is the calling convention that MKL assumes for these functions?
Thanks,
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Daniel,
Right, everything in MKL is called using __cdecl convention.
On Win32 there is support for ancient Compaq Visual Fortran (CVF) interface (by linking user app in CVF with mkl_intel_s.lib) which is __stdcall.
Regards
Ying
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Seems like there is some evidence that the expected calling convention is __cdecl: Compiling with -Gz (which implies __stdcall) my application crashes in mkl_serv_allocate(). Compiling without -Gz (which implies __cdecl, I think) everything works fine.
Can someone confirm that the functions should be __cdecl?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Daniel,
Right, everything in MKL is called using __cdecl convention.
On Win32 there is support for ancient Compaq Visual Fortran (CVF) interface (by linking user app in CVF with mkl_intel_s.lib) which is __stdcall.
Regards
Ying
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page