Commit Graph

17 Commits

Author SHA1 Message Date
simonb 2a7583869f Make mstats() decl match prototype so this compiles with -DMSTATS. 2023-07-08 04:09:26 +00:00
uwe 5c44d8113a bsdmalloc(3): fix malloc() signature 2023-07-06 01:32:52 +00:00
riastradh d5888fcbdb libbsdmalloc: Use a multiply-overflow that clang supports too.
XXX pullup-10
2023-07-05 22:13:20 +00:00
riastradh 9e6ac21a6f libbsdmalloc: Make aligned_alloc(A, S) actually align when A > S.
XXX pullup-10
2023-07-05 12:08:49 +00:00
riastradh c9e3880ca2 libbsdmalloc: Lift C11 divisibility restriction on aligned_alloc.
Restriction was lifted in C17.

XXX pullup-10
2023-07-05 10:57:44 +00:00
rillig 3cc9538e51 bsdmalloc.3: fix typos in function parameters 2023-07-05 07:13:56 +00:00
riastradh 4651d9e04b libbsdmalloc: Fix build with DEBUG.
Nix __P while here.

XXX pullup-10
2023-07-05 01:15:47 +00:00
riastradh 6c3f4940f3 libbsdmalloc: Nix K&R definitions. Bump WARNS to 3. 2023-07-04 18:40:14 +00:00
riastradh 2daa8bfe20 libbsdmalloc: New man page.
XXX pullup-10
2023-07-04 16:23:15 +00:00
riastradh 77b23e4e0e libbsdmalloc: Bump shlib minor.
New symbols, new minor.

XXX pullup-10
2023-07-04 16:22:10 +00:00
riastradh d95fa52655 libbsdmalloc: Nix trailing whitespace.
No functional change intended.

XXX pullup-10
2023-07-04 15:09:04 +00:00
riastradh d6f78684fe libbsdmalloc: Provide all allocator front ends and fork hooks.
Front ends:

- aligned_alloc
- calloc
- posix_memalign

Fork hooks:

- _malloc_prefork
- _malloc_postfork
- _malloc_postfork_child

Otherwise these will pull in the jemalloc definitions from libc,
which (a) defeats the purpose, and (b) won't work correctly with
fork and threads.

Thanks to kre@ and the thread on tech-userlevel for pointing me in
the right direction to making this actually work to override
jemalloc:

https://mail-index.netbsd.org/tech-userlevel/2023/06/30/msg013957.html

Note: libbsdmalloc doesn't set errno=ENOMEM on malloc failure, but
these front ends do (even aligned_alloc, which is from C11, which
doesn't define ENOMEM at all, but this pacifies our aligned_alloc
tests in t_posix_memalign.c).  Might want to fix that.

XXX pullup-10
2023-07-04 15:08:55 +00:00
matt 572e1c8587 These directories don't handle WARNS=5 2012-03-21 10:08:30 +00:00
joerg 61ae1a1c52 Define _REENT. Extend CPPFLAGS. 2011-04-10 16:47:39 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
lukem 7b6e5e6602 NOxxx= variables must appear before <bsd.own.mk> 2003-07-10 11:27:45 +00:00
elric 645dee56e4 Adding libbsdmalloc which is Chris Kingsley's `power of two bucket' malloc.
Suggested by christos.
2003-04-21 22:21:06 +00:00