Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread Dan Cross
On Tue, Jun 28, 2022 at 11:38 AM adr wrote: > On Tue, 28 Jun 2022, Dan Cross wrote: > > You mean by `newthread` and `chancreate`? Those are part of the > > thread library. Notice that there are no callers outside of > > /sys/src/libthread. > > What I mean is that "size" in _threadmalloc() will

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread adr
On Tue, 28 Jun 2022, Dan Cross wrote: You mean by `newthread` and `chancreate`? Those are part of the thread library. Notice that there are no callers outside of /sys/src/libthread. What I mean is that "size" in _threadmalloc() will be set by those functions with values directly given by the

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread Dan Cross
On Tue, Jun 28, 2022 at 10:22 AM adr wrote: > On Tue, 28 Jun 2022, Dan Cross wrote: > > [snip] > > Given the name of the function (`_threadmalloc`), I'd guess that this isn't > > intended for general use, but rather, for the internal consumption of the > > thread library, where indeed such a

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread adr
On Tue, 28 Jun 2022, Dan Cross wrote: [...] void* _threadmalloc(long size, int z) { void *m; m = malloc(size); if (m == nil) sysfatal("Malloc of size %ld failed: %r", size); setmalloctag(m, getcallerpc()); totalmalloc += size; if (size >

Re: [9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread Dan Cross
On Tue, Jun 28, 2022 at 9:01 AM adr wrote: > On Sun, 26 Jun 2022, adr wrote: > > [snip] > > /sys/src/libthread/lib.c > > > > [...] > > void* > > _threadmalloc(long size, int z) > > { > > void *m; > > > > m = malloc(size); > > if (m == nil) > > sysfatal("Malloc of

[9fans] Re: _threadmalloc() size>100000000; shouldn't be totalmalloc?

2022-06-28 Thread adr
On Sun, 26 Jun 2022, adr wrote: Date: Sun, 26 Jun 2022 09:50:19 + (UTC) From: adr To: 9fans@9fans.net Subject: _threadmalloc() size>1; shouldn't be totalmalloc? /sys/src/libthread/lib.c [...] void* _threadmalloc(long size, int z) { void *m; m = malloc(size); if