Re: [m-users.] Passing blobs over the foreign lanuage interface
Volker Wysk <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Am Sonntag, dem 12.02.2023 um 00:48 +1100 schrieb Zoltan Somogyi: > 2023-02-12 00:29 GMT+11:00 "Volker Wysk" <[email protected]>: > > The right type for a BLOB should be array(uint8). > > Logically, a blob corresponds only to the *items* in an array(uint8). > An actual array(uint8) consists of the items *and* the array size. > There is also the issue that Mercury's array type constructor, > being generic, reserves a word of memory for each item. > Not only is this overkill when the items are uint8s, it also means > that the uint8s are not next to each other, which contradicts the > usual definition of a "blob". > > The Mercury standard library module that most closely matches > a blob is the bitmap module, though it is more general, as it can also > represent a bit sequence whose length is not a multiple of 8. > Have a look. Note that its C interface is not in the manual either, > but if you have a look at runtime/mercury_types.h and its definition > of MR_BitmapPtr, you should learn all you need to know. > > The Thanks for the fast answer. But it seems like it has been cropped? Volker _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmPnnscACgkQ+K4ydFOs HoX2MA//ejMlc2MWZM9YRjlm045Ogn0Unq1nBgSKxeKu5Lzd2bU8NpEAyiF7lXM7 tuuAvGVSqyzt/XOrUYyVQTaeTDHrXj6/4AeuFNX0YaDLm9SqkMJuezf4PfA+w4Lk 23b6UKMcTqMs/rTGyvTFgSkK4bfzWkp7wOQ8W+4sCPjtNVMC88l6ZAemHy+4q2Oi Se8TBagZn0Px/e/U9cMAJVpF91CTxYifxbOckKz8xVFgZ6VCJY/XFy5uTOJYrgpI QS4uwf3arf8PH3dExNqRAQIPLhqINMgVBqz6JDhDpisPeST3oOqOdIhL+z9ghi7S 13JwyAn69aOg27hyAAQsdUqG50Iy3JKzsj/9PeczFJ/+viL2U8tOGxvWG0Whs8og Zfz8dblcOeCAafnxCCnHdGs+JaYAa9Q7ZJ8AO9WZG3FcBgd/IMH7kWLbX+qO83YE x6/RI2XUEa+eD2V0Pe8NZfKCNIjTPWqQrmmtYNBsY3nRDcyk+FzMhPd0f7608/ZX tfojmFxVdAQLmPwkz1uHIQ5RKwh2KeLZ7BDBEsGbPecvwSC8Mweo+zLNfDbSzXku dXWFXsSmDK4OcC5bh6ZgMsCn2LLipxx9W869Wv+3zgg+zgLXxObHdXSPKsUE1kEI a+6f4hint4GBX3wUTI0u3GW97Jq3JTThIhFL63QrDZqovbTWMBo= =OxSL -----END PGP SIGNATURE-----