Skip to content

No endian safety #1

@dktapps

Description

@dktapps

The vast majority of devices and machines these days are little-endian, but this extension doesn't consider the possibility of being compiled and run on a big-endian platform. If it is run on a big-endian platform, then lots of unpleasant things could occur, like word array corruption, generated chunks having the wrong byte order, client crashes, and so on and so forth.

Initial tests (with extra hacks to stop client crashes) yield the following results:
screenshot_20180430-193845
screenshot_20180430-194008

Since both disk saves and network sends are little endian, it would probably be best to have some big-endian-specific conversion code to translate little-endian packed byte arrays to/from big-endian in-memory format on the interfaces. This would produce some minor performance loss for big-endian platforms, but I think those are rare enough that nobody should really care.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions