home.social

#alloca — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #alloca, aggregated by home.social.

fetched live
  1. So, you want to know how #alloca stacks up, eh? 🤔 Get ready for a snooze-fest with more #buzzwords than a Silicon Valley #startup pitch. 😴 Who knew stacking #memory could be so... bloated? 🙄
    devblogs.microsoft.com/oldnewt #SiliconValley #bloated #techhumor #HackerNews #ngated

  2. Учимся рефакторить код на примере багов в TDengine, часть 2: макрос, пожирающий стек

    Проверяя код проекта TDengine с помощью PVS-Studio, можно встретить код с запахом, канонические ошибки и опечатки. Многое из этого можно избежать, если изначально аккуратно оформлять код, делать логику простой и избегать макросов. Давайте рассмотрим некоторые фрагменты кода и подумаем, как можно провести его рефакторинг так, чтобы багам просто не было там места.

    habr.com/ru/companies/pvs-stud

    #c #cpp #си #си++ #pvsstudio #рефакторинг #информационная_безопасность #sast #alloca #сортировка_пузырьком #качество_кода #статический_анализ_кода #обзор_кода

  3. My question about #alloca arose because I was reminiscing about having to use the fake alloca on 3B systems. The stack is a linked list on 3B, not a big array.

    This wouldn’t present a problem for variable-size arrays: the C compiler could simply insert mallocs and frees as needed.

  4. Is there any good reason to use #alloca anymore, given C has now long been able to do the same thing but so it gets reclaimed when leaving scope?

    Alloca causes problems with template expansion in #ATS. The problem is you have weak control over where a return from subroutine will occur.

    (I have been recently invented a method where you allocate a fixed size array but get a heap object if you need something bigger. It works only if you have a garbage collector, but is safer than stack.)