Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Mar 2017 15:27:31 +0200
From:      Alexander Tarasikov <alexander.tarasikov@gmail.com>
To:        Slawa Olhovchenkov <slw@zxy.spb.ru>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: jmalloc in shared memory
Message-ID:  <CAMChaFw2Z0zQ5mBgCGxt4Yigjaa-i5oTFJFgDtGHOy6t_DXcnw@mail.gmail.com>
In-Reply-To: <20170320131235.GB86500@zxy.spb.ru>
References:  <20170320131235.GB86500@zxy.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Slawa,
I'm not sure jemalloc is supposed to be used this way, but you should
be able to achieve this functionality in two ways:
1. Editing jemalloc's allocator ("src/pages.c") to allocate in your
region instead of calling mmap()
2. Hook mmap() and brk(), sbrk() with LD_PRELOAD and provide
implementations that will allocate in the shared memory

Hope this helps.

On Mon, Mar 20, 2017 at 2:12 PM, Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:
> How I can use jmalloc in shared memory?
>
> I.e. parent process do mmap w/ MAP_ANON|MAP_SHARED, create jmalloc
> "instance" in this memory and use jmalloc routines for memory management
> in this region.
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"



-- 
Regards, Alexander



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMChaFw2Z0zQ5mBgCGxt4Yigjaa-i5oTFJFgDtGHOy6t_DXcnw>