Yo Soy Freeman on Nostr: So, i want to create a wall system, i need to be able to add segments to an array, ...
So, i want to create a wall system, i need to be able to add segments to an array, but i don't want to pre allocate crazy memory, how do i work with this?
I create a new array which is one element bigger, copy everything from the older one, and put the new data in the empty slot, and then remove the old one from memory?
Published at
2024-06-02 21:48:09Event JSON
{
"id": "2b77014c1cd6038802b1aa670e10804f19fb60a3d4d00552931252628aedd2c4",
"pubkey": "49ba75d9934fc475a43386ff2f28e9070e8f52be9ff882da5d49ccd137f1882b",
"created_at": 1717357689,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.gamedev.place/users/YoSoyFreeman/statuses/112548753570547422",
"activitypub"
]
],
"content": "So, i want to create a wall system, i need to be able to add segments to an array, but i don't want to pre allocate crazy memory, how do i work with this?\n\nI create a new array which is one element bigger, copy everything from the older one, and put the new data in the empty slot, and then remove the old one from memory?",
"sig": "2718e01a06833b449b5ff4fa0d708c7cc76aff6bd8b09c9ac067e1e324a690f57e228b00779b7752fbb31a5e8b180c364f6d1a9dd19368de52f18a51455c1691"
}