Readit News logoReadit News
Bhurn00985 commented on Show HN: Using stylometry to find HN users with alternate accounts   stylometry.net/... · Posted by u/costco
Bhurn00985 · 3 years ago
Just a heads up that for everyone who doesn't like to link their alt accounts, maybe not use this tool to see if it works.

Unless the author would run this against all HN user accounts, no need to flag the ones "of interest".

Bhurn00985 commented on My Overemployment Story   overemployee.blog/my-over... · Posted by u/thunderbong
ineedasername · 3 years ago
I don't know what you mean by "cleared world". Can you explain?
Bhurn00985 · 3 years ago
jobs requiring security clearances
Bhurn00985 commented on Ask HN: Are there no good to-do and list apps?    · Posted by u/komakino
Bhurn00985 · 3 years ago
Microsoft TODO works well for me, and is free
Bhurn00985 commented on C23 Implications for C Libraries   htmlpreview.github.io/?ht... · Posted by u/sigsev_251
jabl · 3 years ago
> I don't fully understand the need or benefit of having free_sized() available tbh.

It's a performance optimization. Allocator implementations spend quite a lot of time in free() matching the provided pointer to the correct size bucket (as to why they don't have something like a ptr->bucket hash table, IDK, maybe it would consume too much memory overhead particularly for small allocations?). With free_sized() this step can be jumped over.

Bhurn00985 · 3 years ago
Thanks for your insights, which prompted to actually jump into the malloc.c implementation.
Bhurn00985 commented on C23 Implications for C Libraries   htmlpreview.github.io/?ht... · Posted by u/sigsev_251
davidtgoldblatt · 3 years ago
My usages are similar to yours, but new C standards still benefit me because I can opportunistically detect and make use of new features in a configure script.

To use my baby as an example: free_sized(void *ptr, size_t alloc_size) is new in C23. I can detect whether or not it's available and use it if so. If it's not available, I can just fall back to free() and get the same semantics, at some performance or safety cost.

Bhurn00985 · 3 years ago
I don't fully understand the need or benefit of having free_sized() available tbh.

Spec says it's functionally equivalent to free(ptr) or undefined:

If ptr is a null pointer or the result obtained from a call to malloc, realloc, or calloc, where size size is equal to the requested allocation size, this function is equivalent to free(ptr). Otherwise, the behavior is undefined

Even the recommended practice does not really clarify things:

Implementations may provide extensions to query the usable size of an allocation, or to determine the usable size of the allocation that would result if a request for some other size were to succeed. Such implementations should allow passing the resulting usable size as the size parameter, and provide functionality equivalent to free in such cases

When would someone use this instead of simply free(ptr) ?

Bhurn00985 commented on Ask HN: What is the most impactful thing you've built?    · Posted by u/rafiki6
Bhurn00985 · 3 years ago
The security architecture for a new aircraft.
Bhurn00985 commented on Is this the end of crypto?   economist.com/leaders/202... · Posted by u/edward
Bhurn00985 · 3 years ago
Are we already seeing the positive impact on total energy consumption levels ? What a waste this has been.
Bhurn00985 commented on Ask HN: Why so many Indians work in US/Australia instead of India?    · Posted by u/dev_0
Bhurn00985 · 3 years ago
Are there really that many as a fraction of total Indian population ?

u/Bhurn00985

KarmaCake day215January 11, 2022View Original