Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Re: Status of PartitionAlloc for external users

91 views
Skip to first unread message

Keishi Hattori

unread,
Nov 20, 2024, 3:50:55 AM11/20/24
to Erik Corry, Stephen Nusko, Yuki Shiino, Chromium-dev, Kentaro Hara, Benoit Lize, ta...@google.com
Hi Erik!
+Stephen Nusko 
Skia, Dawn and Pdfium all use PartitionAlloc from other repos so V8 should be able to use it too.
+Yuki Shiino has talked about defining an external API but it wasn't required so we haven't gotten around to making the change.


On Wed, Nov 20, 2024 at 5:45 PM Keishi Hattori <kei...@google.com> wrote:
Hi Erik!
+Stephen Nusko 
Skia, Dawn and Pdfium all use PartitionAlloc from other repos so V8 should be able to use it too.
+Yuki Shiino has talked about defining an external API but it wasn't required so we haven't gotten around to making the change.


On Tue, Nov 19, 2024 at 10:52 PM Erik Corry <erik...@chromium.org> wrote:
Hi

I need a memory allocator that supports different partitions, for running V8 in multi-sandbox mode.  It's necessary for ArrayBuffer backings to be allocated inside the correct sandbox. There's a simple one in the V8 API, but it is likely to be low performance.

I took a look at PartitionAlloc, which is what Chromium uses but it looks a bit unfinished.  It's not clear which .h files constitute the external API and which ones are internal-only or testing .h files (any clarification appreciated).

In addition it apparently only supports 4 pools/partitions at the moment, whereas I would need one for each sandbox.  I'm not sure how fundamental this is.  It would be possible for me to use an API where I passed a pool identifier to every allocation and deallocation, if the issue is just being able to find the pool, given an address to be freed.

Is it unrealistic to use PartitionAlloc in production?

-- 
Erik Corry


--
- Keishi

Keishi Hattori

unread,
Nov 20, 2024, 7:16:44 AM11/20/24
to Erik Corry, Stephen Nusko, Yuki Shiino, Chromium-dev, Kentaro Hara, Benoit Lize, ta...@google.com
Ah I see. Then we don't have precedence for that kind of usage. And we don't have Bazel build files.

On Wed, Nov 20, 2024 at 8:58 PM Erik Corry <erik...@chromium.org> wrote:
It looks like PDFium doesn't use PartitionAlloc for in-sandbox allocations, which is the exact thing I wanted to use it for.

On Wed, Nov 20, 2024 at 10:50 AM Erik Corry <erik...@chromium.org> wrote:
Thanks.  I'm not using it in V8 as such, but in Cloudflare's Workers project, which embeds V8.

Are there Bazel build files for PartitionAlloc?

Erik Corry

unread,
Nov 21, 2024, 7:03:45 PM11/21/24
to Chromium-dev, Kentaro Hara, Keishi Hattori, Benoit Lize, ta...@google.com

Erik Corry

unread,
Nov 21, 2024, 7:04:27 PM11/21/24
to Keishi Hattori, Stephen Nusko, Yuki Shiino, Chromium-dev, Kentaro Hara, Benoit Lize, ta...@google.com
It looks like PDFium doesn't use PartitionAlloc for in-sandbox allocations, which is the exact thing I wanted to use it for.

On Wed, Nov 20, 2024 at 10:50 AM Erik Corry <erik...@chromium.org> wrote:
Thanks.  I'm not using it in V8 as such, but in Cloudflare's Workers project, which embeds V8.

Are there Bazel build files for PartitionAlloc?

Erik Corry

unread,
Nov 21, 2024, 7:04:58 PM11/21/24
to Keishi Hattori, Stephen Nusko, Yuki Shiino, Chromium-dev, Kentaro Hara, Benoit Lize, ta...@google.com
Thanks.  I'm not using it in V8 as such, but in Cloudflare's Workers project, which embeds V8.

Are there Bazel build files for PartitionAlloc?

Reply all
Reply to author
Forward
0 new messages