19:52 | <snek> | shu: if you set kMaxTypedArrayInHeap to 0, and allocate an empty buffer, it will use an empty on-heap buffer: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/typed-array-createtypedarray.tq;l=95?q=typedarrayinitialize&ss=chromium which is not inherently bad ig, but it leads to a weird thing where an embedder using max=0 will find that some empty typedarrays have a non-null data pointer. i assume this isn't directly intentional but i'm curious, given the sensitivity of arraybuffer stuff, whether v8 would be accepting of CLs to change this. |
19:56 | <shu> | i don't know the implications of changing it. is it an important invariant in your embedding that max=0 implies null data ptr? |
19:58 | <snek> | its generally established in the node/node adjacent ecosystem that native addons see null pointers for empty buffers. we do have a workaround for it though: https://github.com/denoland/deno/blob/main/ext/ffi/ir.rs#L373-L381 |
19:59 | <shu> | it's worth asking the question at least. i don't know the current reason for its being like that, or how important it is, off the top of my head |
19:59 | <snek> | kk, i'll poke around a bit more then. thanks |