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
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 si
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(&size));
totalmalloc += size;
if (size > 100
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 large
Andrey, if you want to use different note handlers per process (with a big
number of processes) using libthread, this may be helpful.
The idea is this:
An array of handlers for all processes which can be changed by all processes.
When a note is received by a process, this array takes priority.
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 pr
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 be
Quoth adr :
> Andrey, if you want to use different note handlers per process (with a big
> number of processes) using libthread, this may be helpful.
>
> The idea is this:
>
> An array of handlers for all processes which can be changed by all processes.
> When a note is received by a process, thi
On Tue, 28 Jun 2022, adr wrote:
Andrey, if you want to use different note handlers per process (with a big
number of processes) using libthread, this may be helpful.
The idea is this:
An array of handlers for all processes which can be changed by all processes.
When a note is received by a pro
On Tue, 28 Jun 2022, adr wrote:
This just evade going through the arrays twice. For the current
value of NFN it doesn't make too much a difference, note that this
structures are locked. It just was hurting my eyes.
Sorry for the noise, bad patch.
--- /tmp/main.c
+++ /sys/src/libthread/main.c
@@
В Вт, 28/06/2022 в 15:28 +, adr пишет:
> Andrey, if you want to use different note handlers per process (with
> a big
> number of processes) using libthread, this may be helpful.
>
> The idea is this:
>
> An array of handlers for all processes which can be changed by all
> processes.
> When a
On Tue, 28 Jun 2022, andrey100100...@gmail.com wrote:
Thanks for the patch.
It's just to play with it, note that onnote should be just passed
once. I'll post another patch if things work ok.
adr
--
9fans: 9fans
Permalink:
https://9fans.topicbox.com/gr
12 matches
Mail list logo