Skip to content
This repository was archived by the owner on Feb 11, 2024. It is now read-only.

add 32 bit architecture support #24

Merged
merged 3 commits into from
Aug 13, 2021
Merged

Conversation

unsuitable001
Copy link
Contributor

@unsuitable001 unsuitable001 commented Aug 11, 2021

Use an array of uint64 to store the memory addresses of arguments (of cronet callbacks). On 32 bit systems, we must store the memory address on the lower 32 bits of uint64 and upper 32 bits should be padded by 0.

Closes #20

Copy link
Member

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also run 32 bits on the CI for the various OSes?

@unsuitable001
Copy link
Contributor Author

unsuitable001 commented Aug 13, 2021

Can we also run 32 bits on the CI for the various OSes?

@dcharkes Don't think so. https://github.community/t/does-github-actions-support-multiple-os-architectures/16526/2

Can we force Dart to run in 32 bit mode (maybe using some flags?)

I test locally by running Android Emulator 😅 which is very slow in my low end machine.

Otherwise, changes are done 😀. Hope this time I understood it correctly.

@unsuitable001 unsuitable001 requested a review from dcharkes August 13, 2021 13:44
Copy link
Member

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we force Dart to run in 32 bit mode (maybe using some flags?)

No, you need a different SDK. ia32 is available for Linux and Windows as standalone Dart: https://dart.dev/tools/sdk/archive#stable-channel
I don't think Flutter has a 32 bit SDK available: https://flutter.dev/docs/development/tools/sdk/releases?tab=linux

We don't need a GitHub actions machine that does 32 bit, just a 32 bit SDK. But since we're doing Flutter instead of Dart standalone now we can forget that. :)

src/wrapper.cc Outdated
@@ -127,8 +128,10 @@ Dart_CObject CallbackArgBuilder(int num, ...) {
void *request_buffer = malloc(sizeof(uint64_t) * num);
uint64_t *buf = reinterpret_cast<uint64_t *>(request_buffer);

// uintptr_r will get implicitly casted to uint64_t. So, in a 32 bit machine,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: 32 bit machine
You can run things in 32 bit mode on 64 bit machines.

Document why this is important: because its read in Dart as a 64 bit integer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Is the new one good?

@dcharkes dcharkes merged commit db50ed6 into google:main Aug 13, 2021
@unsuitable001 unsuitable001 deleted the 32bit_support branch August 13, 2021 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

32 Bit system support
2 participants