Add tests of kmath-memory and make all the memory operations on all the platforms use little-endian byte order #163

Closed
CommanderTvis wants to merge 4 commits from unify-endianness into dev
CommanderTvis commented 2020-12-10 14:16:04 +03:00 (Migrated from github.com)
No description provided.
altavir (Migrated from github.com) requested changes 2021-01-05 17:01:15 +03:00
altavir (Migrated from github.com) left a comment

Keeping endians across platform does not make any sense. It is possible to define additional memory, that is shareable between platforms, but I do not want to guarantee that for the default memory.

Keeping endians across platform does not make any sense. It is possible to define additional memory, that is shareable between platforms, but I do not want to guarantee that for the default memory.
CommanderTvis commented 2021-01-05 17:03:13 +03:00 (Migrated from github.com)

Keeping endians across platform does not make any sense. It is possible to define additional memory, that is shareable between platforms, but I do not want to guarantee that for the default memory.

It does. We provide ways to wrap existing object as memory (Memory.wrap), and it has to work equally on all the supported platforms.

> Keeping endians across platform does not make any sense. It is possible to define additional memory, that is shareable between platforms, but I do not want to guarantee that for the default memory. It does. We provide ways to wrap existing object as memory (Memory.wrap), and it has to work equally on all the supported platforms.
CommanderTvis commented 2021-01-05 17:03:53 +03:00 (Migrated from github.com)

e.g., Memory.wrap(byteArrayOf(0,0,0,1)).read { readInt(0) } must be persistent

e.g., `Memory.wrap(byteArrayOf(0,0,0,1)).read { readInt(0) }` must be persistent
altavir commented 2021-01-05 17:36:42 +03:00 (Migrated from github.com)

I can't see, why it should. We do not allow to access the inner layout of memory, only the offset.

I can't see, why it should. We do not allow to access the inner layout of memory, only the offset.
CommanderTvis commented 2021-01-05 17:39:16 +03:00 (Migrated from github.com)

I can't see, why it should. We do not allow to access the inner layout of memory, only the offset.

Because it's almost useless it is does not because each platform must receive separate byte arrays.

> I can't see, why it should. We do not allow to access the inner layout of memory, only the offset. Because it's almost useless it is does not because each platform must receive separate byte arrays.
CommanderTvis commented 2021-01-05 17:39:48 +03:00 (Migrated from github.com)

Why do we need wrapping of array if it works in absolutely different way on each platform

Why do we need wrapping of array if it works in absolutely different way on each platform
altavir commented 2021-01-05 18:22:45 +03:00 (Migrated from github.com)

Currently, Memory is the inner implementation detail. Do we even need wrapping of arrays?

Currently, Memory is the inner implementation detail. Do we even need wrapping of arrays?
CommanderTvis commented 2021-01-05 18:35:57 +03:00 (Migrated from github.com)

We may drop it as well as file reading in JVM

We may drop it as well as file reading in JVM
altavir commented 2021-01-05 19:30:05 +03:00 (Migrated from github.com)

File reading does not break any rules, but I agree it is useless right now, so it could be commented out.

File reading does not break any rules, but I agree it is useless right now, so it could be commented out.
CommanderTvis commented 2021-04-27 18:51:11 +03:00 (Migrated from github.com)

Stale PR, the problem itself has to be discussed

Stale PR, the problem itself has to be discussed

Pull request closed

Sign in to join this conversation.
No description provided.