Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement reflect.AppendSlice #1902

Merged
merged 2 commits into from
May 22, 2021
Merged

Implement reflect.AppendSlice #1902

merged 2 commits into from
May 22, 2021

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented May 22, 2021

This implementation basically just calls through to the runtime implementation of the append built-in (runtime.sliceAppend) with a few extra checks to ensure type safety.

See: #1879 (comment)

aykevl added 2 commits May 22, 2021 18:26
These variants uses an unsafe.Pointer instead of uintptr so that the
pointer/non-pointer fields match those of real slices and strings. This
may be necessary in the future once we switch to a precise garbage
collector.
This implementation of AppendSlice simply calls through to the version
used in the runtime: runtime.sliceAppend.
@deadprogram
Copy link
Member

Very cool! ➕

Now merging.

@deadprogram deadprogram merged commit 541d8dc into dev May 22, 2021
@deadprogram deadprogram deleted the reflect-AppendSlice branch May 22, 2021 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants