Category "allocation"

how python [0] * 3 are independent but [[0] * 3] * 3 each sub list is the same object? [duplicate]

my_list = [0] * 3 my_list[0] = 1 outputs to [1, 0, 0] my_2ndlist = [[0] * 3] * 3 my_2ndlist[1][1] = 5 outputs to [[0, 5, 0], [0, 5, 0], [0,

String allocation behaving strangely

This compiles fine (from the rust lang book): fn main() { let mut s = String::from("hello"); s.push_str(", world"); println!("{}", s); } This does

Can I use both static and dynamic allocation in FreeRTOS?

I have some modules of application designed for static allocation, and some modules designed for dynamic allocation. Can I use both static and dynamic allocatio

C, Do structs with multiple dynamically allocated arrays need to be resized for every allocation?

Below I have a struct with multiple dynamically allocated char arrays. It compiles, Valgrind indicates no issues and it functions as anticipated. Earlier, someo

Is there a way to Marshal a byte[] into a string without copying in C#?

I am in the process of building a sub-part of a native application, namely a Unity application that runs as a child of a different application written in a comp

Passing allocatable array into a subroutine

I am working on a f90 code that I didn't write. I am not a very experienced fortran user. There is a part that bothers me a bit and I am not sure if it is a nor