You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of commit 252cecb, the malloc function is not provided by the pulp-runtime. Is that a choice or an omission?
Steps to reproduce
Clone the repository: git clone https://github.com/pulp-platform/pulp-runtime.git
Got to the root of the repository: cd pulp-runtime
Search for malloc with grep: grep -R "void \*malloc"
This should yield a single result, which is the declaration of malloc in the stdlib header file.
Alternatively, one can:
Install the pulp-builder toolchain, which in turns installs pulp-runtime
Write a project which uses malloc
Compile it. The compiler won't complain because malloc is declared in a header, however the linker will fail because no implementation for the function is provided
Additional Information
The function was provided in the pulp-rt repository, see io.c, and there is a low-level allocator in the current pulp-runtime, see the pos_alloc function in the kernel.
Note that the free function is also missing.
Request for Change
Would it be possible to provide an implementation for malloc if it was forgotten? Should the removal be intentional, could the declaration be also removed from the stdlib header? That way, the compiler will warn a user about the missing malloc, instead of yielding a more obscure linker error.
On the other hand, if there is a reason for keeping the situation as it is now, would it possible to provide the explanation either as a comment in the stdlib header, or maybe in the README of the repository?
Regardless, thank you all for the work on this great project!
The text was updated successfully, but these errors were encountered:
Indeed, thank you for your suggestions. For our application we don't need a full stdlib, and I would understand if you want to keep pulp-runtime minimal and thus not include malloc and free. We could probably work around that by using pos_alloc and pos_free directly in our case.
Regardless, I have sent a pull request #16 on the GitHub repository, that way you can judge how much new code would be needed for malloc and if it should be included in the basic runtime.
If you decide not to include malloc and free feel free to reject the Pull Request, but in that case I would advise also removing them from the stdlib header to get a clear compilation error.
Dear all,
As of commit 252cecb, the
malloc
function is not provided by the pulp-runtime. Is that a choice or an omission?Steps to reproduce
git clone https://github.com/pulp-platform/pulp-runtime.git
cd pulp-runtime
grep -R "void \*malloc"
This should yield a single result, which is the declaration of
malloc
in the stdlib header file.Alternatively, one can:
malloc
malloc
is declared in a header, however the linker will fail because no implementation for the function is providedAdditional Information
The function was provided in the pulp-rt repository, see io.c, and there is a low-level allocator in the current pulp-runtime, see the pos_alloc function in the kernel.
Note that the
free
function is also missing.Request for Change
Would it be possible to provide an implementation for
malloc
if it was forgotten? Should the removal be intentional, could the declaration be also removed from the stdlib header? That way, the compiler will warn a user about the missingmalloc
, instead of yielding a more obscure linker error.On the other hand, if there is a reason for keeping the situation as it is now, would it possible to provide the explanation either as a comment in the stdlib header, or maybe in the README of the repository?
Regardless, thank you all for the work on this great project!
The text was updated successfully, but these errors were encountered: