While not currently possible, we plan on accommodating use cases such
as this through first-class allocators via type parameters. You'll be
able to specify your own allocator an standard library routines that
allocate memory.

Your other option currently is to link to libcore (which doesn't
provide an allocator), but you lose out on the functionality of the
standard library.

On Sun, May 11, 2014 at 10:30 AM, Noah Watkins <[email protected]> wrote:
> I've used the language item `exchange_malloc` to override the default
> allocation routine with a custom allocator. A simple example works
> fine, but I'm having trouble integrating it into a larger project.
>
> In particular, how can I use my new allocator and still have access to
> all of libstd such that all allocations (even those done in libstd)
> are routed through my allocator? As it stands now it only works with
> `#![no_std]`, otherwise I get duplicate entries for things like
> `allocate`.
>
> Thanks,
> Noah
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to