supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* skalibs build failure
@ 2011-06-30 19:48 Lorenzo Beretta
  2011-06-30 20:42 ` Laurent Bercot
  2011-07-06 14:51 ` genalloc Vincent de RIBOU
  0 siblings, 2 replies; 4+ messages in thread
From: Lorenzo Beretta @ 2011-06-30 19:48 UTC (permalink / raw)
  To: supervision

Undeclared variable in selfpipe_trap.c and selfpipe_untrap.c:

script -c ./package/install ; cat typescript
==>
Script started on Thu 30 Jun 2011 09:41:08 PM CEST
Linking ./src into ./compile...

Importing ./conf-compile files into the build tree...
(Remove the compile/ subdirectory if conf-compile/ has been modified
since the last build.)

Linking include files...

Making subsystem systype...
make: Nothing to be done for `it'.
Subsystem systype done.

Making subsystem sys...
make: Nothing to be done for `it'.
Subsystem sys done.

Making subsystem sysdeps...
make: Nothing to be done for `it'.
Subsystem sysdeps done.

Making subsystem headers...
make: Nothing to be done for `it'.
Subsystem headers done.

Making subsystem libstddjb...
./gen-Makefile > Makefile.real && make -f Makefile.real && : > .done
make[1]: Entering directory 
`/usr/local/package/prog/skalibs-1.0.0/compile/libstddjb'
exec ./compile selfpipe_trap.c
selfpipe_trap.c: In function ‘selfpipe_trap’:
selfpipe_trap.c:44:17: error: ‘i’ undeclared (first use in this function)
selfpipe_trap.c:44:17: note: each undeclared identifier is reported only 
once for each function it appears in
make[1]: *** [selfpipe_trap.o] Error 1
make[1]: Leaving directory 
`/usr/local/package/prog/skalibs-1.0.0/compile/libstddjb'
make: *** [.done] Error 2

Script done on Thu 30 Jun 2011 09:41:09 PM CEST



PS

Sorry for not providing a patch, but I'm not (yet) comfortable enough 
with signals to write one. And thank you for the libs!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: skalibs build failure
  2011-06-30 19:48 skalibs build failure Lorenzo Beretta
@ 2011-06-30 20:42 ` Laurent Bercot
  2011-07-06 14:51 ` genalloc Vincent de RIBOU
  1 sibling, 0 replies; 4+ messages in thread
From: Laurent Bercot @ 2011-06-30 20:42 UTC (permalink / raw)
  To: supervision

> selfpipe_trap.c: In function ???selfpipe_trap???:
> selfpipe_trap.c:44:17: error: ???i??? undeclared (first use in this 
> function)

 Thanks for the report. Fix on the way.
 For bug-reports on skarnet.org software that is not s6, please
use the skaware@list.skarnet.org mailing-list instead.

-- 
 Laurent


^ permalink raw reply	[flat|nested] 4+ messages in thread

* genalloc
  2011-06-30 19:48 skalibs build failure Lorenzo Beretta
  2011-06-30 20:42 ` Laurent Bercot
@ 2011-07-06 14:51 ` Vincent de RIBOU
  2011-07-06 15:50   ` genalloc Laurent Bercot
  1 sibling, 1 reply; 4+ messages in thread
From: Vincent de RIBOU @ 2011-07-06 14:51 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]



Hi,

After having append many items, I didn't find any API in genalloc to remove an item and then collapse all.

Did I miss something??
Should I implement it with byte_copy??

Thanks.
Vincent

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: genalloc
  2011-07-06 14:51 ` genalloc Vincent de RIBOU
@ 2011-07-06 15:50   ` Laurent Bercot
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Bercot @ 2011-07-06 15:50 UTC (permalink / raw)
  To: supervision; +Cc: skaware

 Please use the skaware@list.skarnet.org list for questions about my
software that are not related to s6 or general supervision things.
 Mail-Followup-To set.


> After having append many items, I didn't find any API in genalloc to remove an item and then collapse all.
> 
> Did I miss something??
> Should I implement it with byte_copy??

 Generally speaking, what you are asking for (to delete a cell in a
genalloc and shift all the following cells to the left) requires a lot
of memory rewriting and is not needed: there's always a way to avoid
shifting.

 Say you have a genalloc g of type T and you want to delete cell number i.

 If you don't care about the order of your cells, just replace the ith
cell with the last one:
  unsigned int n = genalloc_len(T, g) ;
  genalloc_s(T, g)[i] = genalloc_s(T, g)[n-1] ;
  genalloc_setlen(T, g, n-1) ;

 If you care about the order of your cells, a simple genalloc isn't the
best structure. You could use a linked list structure, using the genalloc
for storage purposes only: expand type T with an unsigned int that is
the index of your "next" cell in the genalloc, make 0 the head of your list,
and there you go. No rewriting needed.

 If you really want to shift cells in a genalloc, then yes, I guess you
could implement it with byte_copy(). But it will be suboptimal in all
cases.

-- 
 Laurent


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-06 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 19:48 skalibs build failure Lorenzo Beretta
2011-06-30 20:42 ` Laurent Bercot
2011-07-06 14:51 ` genalloc Vincent de RIBOU
2011-07-06 15:50   ` genalloc Laurent Bercot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).