Skip to content
Snippets Groups Projects
Select Git revision
  • pu
  • passt default
  • master
  • todo
  • next
  • maint
  • v2.8.0-rc1
  • v2.8.0-rc0
  • v2.7.2
  • v2.7.1
  • v2.7.0
  • v2.6.5
  • v2.7.0-rc3
  • v2.7.0-rc2
  • v2.7.0-rc1
  • v2.7.0-rc0
  • v2.6.4
  • v2.6.3
  • v2.6.2
  • v2.6.1
  • v2.3.10
  • v2.5.4
  • v2.4.10
  • v2.6.0
  • v2.6.0-rc3
  • v2.5.3
26 results

alloc.c

Blame
    • Jeff King's avatar
      94d5a22c
      alloc: factor out commit index · 94d5a22c
      Jeff King authored
      
      We keep a static counter to set the commit index on newly
      allocated objects. However, since we also need to set the
      index on any_objects which are converted to commits, let's
      make the counter available as a public function.
      
      While we're moving it, let's make sure the counter is
      allocated as an unsigned integer to match the index field in
      "struct commit".
      
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      94d5a22c
      History
      alloc: factor out commit index
      Jeff King authored
      
      We keep a static counter to set the commit index on newly
      allocated objects. However, since we also need to set the
      index on any_objects which are converted to commits, let's
      make the counter available as a public function.
      
      While we're moving it, let's make sure the counter is
      allocated as an unsigned integer to match the index field in
      "struct commit".
      
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    emper-server-slides.cpp 181 B
    void server(int listen_sock) {
    	auto handler = [](int fd) {
    		auto in = read(fd);
    		auto out = process(in);
    		write(fd, out);
    		close(fd);
    	}
    	tcp_listener(listen_sock, handler);
    }