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

GDScript(?) Packed[BASE]Array(?) weird "data sharing" #36892

Closed
Faless opened this issue Mar 7, 2020 · 2 comments
Closed

GDScript(?) Packed[BASE]Array(?) weird "data sharing" #36892

Faless opened this issue Mar 7, 2020 · 2 comments
Assignees
Milestone

Comments

@Faless
Copy link
Collaborator

Faless commented Mar 7, 2020

Godot version: Godot 4.0.custom 8cb6d5d (likely post poolvector removal)

OS/device including version:
Ubuntu Linux 18.04.4 LTS

Issue description:
In GDScript, packed arrays of base types (e.g. PackedByteArray, PackedFloat32Array, etc), seems to all share the same underlying resource (addressing issue? copy-on-write? ...)

Steps to reproduce/Minimal reproduction project:

extends Node2D

func _ready():
	var b1 = PackedByteArray()
	b1.append(2)
	var my_var = PackedByteArray()
	my_var.resize(3)

	var f1 = PackedFloat32Array()
	f1.append(2)
	var f2 = PackedFloat32Array()
	f2.resize(4)

	printt(b1.size(), my_var.size()) # Prints (3, 3) , should be (1, 3)
	printt(f1.size(), f2.size()) # Prints (4, 4) , should be (1, 4)

Potentially related to #36611 , #36779

@Faless Faless added this to the 4.0 milestone Mar 7, 2020
@nathanfranke
Copy link
Contributor

Still reproducible a09e035

@Faless
Copy link
Collaborator Author

Faless commented Sep 7, 2020

Fixed via #39100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants