3 ms·
There's code for it in Darwin's libmalloc, but it's not exposed as API. reallocarray() has some difficulties as an interface, mostly inherited from realloc().
by achivetta 10y ago
There's code for it in Darwin's libmalloc, but it's not exposed as API.
reallocarray() has some difficulties as an interface, mostly inherited from realloc(). I'm a bigger fan of reallocarr(), but that's NetBSD only. We (the operating systems community) need to find a consensus here, but I'm not convinced that reallocarray() is that consensus yet.
- ben_bai 10y agoreallocarray is a very thin layer around realloc. No surprises there. Simple find and replace to bring overflow checking into your code. reallocarr changes the semantics. Equally easy in new pieces of code and a little harder when converting existing code.
- deleted 10y ago[deleted]