From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5227 Path: news.gmane.org!not-for-mail From: Thorsten Glaser Newsgroups: gmane.linux.lib.musl.general Subject: Re: thoughts on reallocarray, =?utf-8?b?ZXhwbGljaXRfYnplcm8/?= Date: Wed, 11 Jun 2014 09:59:56 +0000 (UTC) Message-ID: References: <20140519153130.GA519@muslin> <20140519162556.GY12324@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1402480833 28170 80.91.229.3 (11 Jun 2014 10:00:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2014 10:00:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5232-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jun 11 12:00:24 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WufKR-0007hX-Td for gllmg-musl@plane.gmane.org; Wed, 11 Jun 2014 12:00:24 +0200 Original-Received: (qmail 11438 invoked by uid 550); 11 Jun 2014 10:00:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11427 invoked from network); 11 Jun 2014 10:00:22 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.198.62.204 (Mozilla/5.0 (X11; Linux 3.14-1-amd64 i686) KHTML/4.13.1 (like Gecko) Konqueror/4.13) Xref: news.gmane.org gmane.linux.lib.musl.general:5227 Archived-At: Szabolcs Nagy port70.net> writes: > static size_t sizemul(size_t a, size_t b) > { > return b>1 && a>1 && a>-1/b ? -1 : a*b; > } There is no -1 in size_t. (And *you* complain about OpenBSD checks…) > i don't see how the openbsd explicit_bzero stops the > compiler to do optimizations.. On OpenBSD: by being in libc which is not built with LTO. I’ve wondered about how to do this either. Maybe: void explicit_bzero(void *s, size_t n) { bzero(s, n); __lto_boundary } Then you #define __lto_boundary to something like __asm__ volatile ("" : : : "memory"); or __sync_synchronize(); or some C11 barrier function. bye, //mirabilos