HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
alcover
buffet
C2022–2022
alcover / buffet

buffet

All-inclusive Buffer for C

3Distinct people
8Mentions
1Explicit recommenders
414GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

All-inclusive Buffer for C

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

Made this C lib for exactly the reasons you mention. I love C but got mad at the constant bounds errors and copying. https://github.com/alcover/buffet

alcover used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month8 dated mentions

Observed mentions: 2022-03-08 00:39:04 UTC to 2022-12-03 19:38:47 UTC.

01232022-03-01 00:00:00 UTC to 2022-04-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 commentsMar 20222022-04-01 00:00:00 UTC to 2022-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-05-01 00:00:00 UTC to 2022-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-06-01 00:00:00 UTC to 2022-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-07-01 00:00:00 UTC to 2022-08-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsJul 20222022-08-01 00:00:00 UTC to 2022-09-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-09-01 00:00:00 UTC to 2022-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-10-01 00:00:00 UTC to 2022-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-11-01 00:00:00 UTC to 2022-12-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-12-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsDec 2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Mar 20222022-03-01 00:00:00 UTC2022-04-01 00:00:00 UTC312
Apr 20222022-04-01 00:00:00 UTC2022-05-01 00:00:00 UTC000
May 20222022-05-01 00:00:00 UTC2022-06-01 00:00:00 UTC000
Jun 20222022-06-01 00:00:00 UTC2022-07-01 00:00:00 UTC000
Jul 20222022-07-01 00:00:00 UTC2022-08-01 00:00:00 UTC110
Aug 20222022-08-01 00:00:00 UTC2022-09-01 00:00:00 UTC202
Sep 20222022-09-01 00:00:00 UTC2022-10-01 00:00:00 UTC000
Oct 20222022-10-01 00:00:00 UTC2022-11-01 00:00:00 UTC000
Nov 20222022-11-01 00:00:00 UTC2022-12-01 00:00:00 UTC101
Dec 20222022-12-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

What Hacker News says

8 sources
> Come again? Of course it can. Oh come on.. I'm pretty sure Walter meant taking a view kind of slice. Obviously one can always copy part of a string, but that's not what slice implies I think. > It can't be done in place, mind you, but that's a pretty bad way to do any string slicing, regardless of implementation, in a manual memory management environment. It's not bad. It's the best, most efficient way. O(1)-ish. > Do most programmers expect their slices to result in undefined behavior if they release the larger string they were made from? I doubt it. That's what copy-on-write is for : release of the parent is blocked until no views are left on it. I made a C String lib using CoW. It works well: https://github.com/alcover/buffet
In Show HN: A nice C string API
alcover·Jul 7, 2022Submission

Proposal for a full-fledged C String

Dynamic allocation, SSO, views, refcounting, etc.. are spread on various implementations. C++ separates string and string_view. And they're not fully compatible. (Ex. you can't concat cross-type !?). Rust has str, &str, String Box<str>, ... ? In the spirit of "a slice of a string is still a string", why not pack it all into a single type ? And offer security in the process. Here's the scheme : https://github.com/alcover/buffet/raw/main/assets/schema.png Here's the code : https://github.com/alcover/buffet NB: I'm talking string/byte buffer. Higher string tooling like Utf8 would go a layer above.
12 points · Open discussion
(following a discussion from https://github.com/alcover/buffet/commit/eab9648ff19483f57fd...) > if nobody's looking, we are go https://github.com/alcover/buffet/blob/dee3eb65f37ca07ea3d27... And otherwise, when is it freed? The refcount mechanism looks wrong to me: either the ownership of internal data is shared between instances (it seems it is not the case), either the owner is well defined and does not need a refcount. It appears that the refcount is used to avoid freeing the owner data if Buffet views are still alive. But using the views after freeing the referenced data is incorrect usage anyway, so it looks like defensive programming, trading a use-after-free for a leak.
In Buffet – An All-inclusive Buffer for C

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.