Commit Graph

17 Commits

Author SHA1 Message Date
Jōshin
a8c19d9bae c3_rand cleanup
This should work on Linux since kernel 3.17, OS X since 10.12, OpenBSD
since 5.6, and FreeBSD since 12.0. It also introduces no external
dependencies. Note that getentropy should only be called with at most
256 bytes or it will return EIO. The getrandom variant on Linux doesn't
check for this. If called with len > 256, it's allowed to produce a
short read if it gets interrupted. This should show up as an error, so
everything's fine.
2019-01-09 09:15:41 -08:00
Jōshin
67c0b7b39b Clean up allocator defs
- Condense the allocator section in defs.h and make it match the
  surrounding style.

- Use real calloc in c3_calloc. Some guy on the internet says
  calloc can be faster than malloc since the OS may not actually
  need to call memset.

- Replace calloc calls in vere code with c3_calloc.

Note that I left the c3_calloc definition as-is (i.e., not taking
a count argument). I was going to change it, but it seems like
count is 1 at all call sites. If it's ever used with count != 1,
I'd be in support of changing it, fwiw.
2019-01-02 11:23:06 -08:00
Joe Bryan
de7df542c9 updates c3_assert() to print assertion/file/line before bail 2018-12-10 17:17:16 -05:00
Joe Bryan
76fbb1d918 adds and uses c3_realloc() 2018-12-08 20:09:23 -05:00
Joseph Bryan
a0b19f125f cleanup 2018-03-05 10:36:35 -05:00
Philip C Monk
9edda1bb73 descriptive names for c files
fixes #294
2015-06-23 21:29:11 -04:00
C. Guy Yarvin
a7215257ac Some renamings and cleanups. 2014-11-05 13:54:52 -08:00
C. Guy Yarvin
dbe046620a Move loobeans from u3 to c3. 2014-11-04 17:18:47 -08:00
C. Guy Yarvin
ceb35b892c About to rename loobeans. 2014-11-04 17:09:17 -08:00
C. Guy Yarvin
e75d2e70b2 Add MurmurHash3. 2014-08-26 12:11:59 -07:00
C. Guy Yarvin
549ff28b41 Speed up interpreter with gcc CLZ intrinsic. 2014-08-22 02:14:37 -04:00
Steve Dee
322d448d0f Jetted en and ex
You'll note that ex involves more endianness twiddling. This is
unfortunate, but en is exactly as stupid as you'd hope it would be,
so I'm going to call it okay.

Also, fixed ex. In particular, (ex:aesc 0) now agrees with the C's
output. Our bad.
2014-04-18 14:58:51 -07:00
~hatteb-mitlyd
75dce9eefc make asserting malloc into a #define 2014-04-03 14:37:32 -07:00
~hatteb-mitlyd
a0c18f56b2 change to asserting malloc 2014-04-01 17:48:26 -07:00
Steve Dee
8aa97708f4 Fix a stupid in c3_log_every 2014-03-07 19:12:21 -08:00
Steve Dee
1e10cd5d95 Clean up connections
The code seems much less racy now.
2014-03-07 20:00:44 +00:00
Christian Carter
3af3130bdc Cleaning up old code 2013-09-28 13:21:18 -07:00