#Pretty code
1 messages · Page 1 of 1 (latest)
This is what it looked like before, however it wouldn't free stuff until the end of the function
wouldn't the first version be faster?
faster? no
why no
freeing allocations after use? yes
it's literally the same speed
no changed order of operations, except for when it frees memory
what's wrong if it doesn't free until the end of the function?
ye but ur mixing in instructions no?
each allocation is like 4 GiB
I see
thats like flushing out a buffer everytime you print something
don't use defer 🙃
yeah, probably do want to free that immediately then lol
if I don't use defer, that could work...
yeah, gonna agree, basically what I would do
yea that's true
eg.
- allocate
- try [failing fuction]
- free memory
does freeing involve any syscalls?
idk, just using the page allocator here
idk either
i mean you have to tell the OS that the memory is available
or FixedBufferAllocator
or I guess, sometimes it doesn't get freed directly back to the OS
if it's GPA
and instead gets put into a freelist
at any rate
ye I haven't measured the performance of freeing immediately
but I would use the buffer analogy
you usually want to do one thing at a time
ok thanks
same here
I'll stick with the tower for now
if you wanted to make it look nicer, probably would have to abstract it into functions