[flang-commits] [flang] [WIP] [flang] Always lower ALLOCATE/DEALLOCATE to runtime calls. (PR #133238)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Mon Apr 7 08:24:27 PDT 2025


clementval wrote:

> > Depending on your use case, you can register new allocator and you can override the default allocator of you want.
> 
> Ah, right. Thanks for pointing me to that!
> 
> However, I do not see how such an allocator would be invoked, when Flang emits direct calls to `malloc` and `free` when compiling `ALLOCATE` and `DEALLOCATE`. I only have seen invocations to the actual Fortran runtime allocation routines, when something like `stat` was present for the `ALLOCATE`/`DEALLOCATE` statement.

They don't get called that's why you can force the allocation via runtime with `useAllocateRuntime`. There is no need to update the code to make it a default since the option is already present. 

https://github.com/llvm/llvm-project/pull/133238


More information about the flang-commits mailing list