Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Francois Berenger <mlists@ligand.eu>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] Could the Marshal module from the stdlib support marshal to/from a Char Bigarray?
Date: Mon, 3 Apr 2023 02:49:04 +0100	[thread overview]
Message-ID: <fffc8e459f16f86e41205f5b598f6560@ligand.eu> (raw)
In-Reply-To: <m2h6u5gx2j.fsf@mac-03220211.irisa.fr>

Dear list,

I posted about this on discuss.ocaml.org, but strangely there is no 
feedback at all.

https://discuss.ocaml.org/t/could-the-marshal-module-from-the-stdlib-support-marshal-to-from-a-char-bigarray/11831/1

---
That would be a useful feature, since memmapped bigarrays are the de 
facto shm
on Unix-likes for multi process programs.

When marshalling, we will need to be able to pass an offset into the 
bigarray buffer.
The function should return how many bytes were written.
Probably, the current Marshal.to_buffer has the right interface.

I think, the current Marshal.from_bytes does not have the right 
interface, the length
that was read from the (future) bigarray buffer should also be returned.

Thanks,
F.

PS: currently in user-space I can marshal to a string then copy that 
string into the bigarray; but this involves unnecessary data copy and 
shms are meant to be used in a high performance setting…

      reply	other threads:[~2023-04-03  1:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28  7:21 [Caml-list] Attn: Development Editor, Latest OCaml Weekly News Alan Schmitt
2023-04-03  1:49 ` Francois Berenger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fffc8e459f16f86e41205f5b598f6560@ligand.eu \
    --to=mlists@ligand.eu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox