Skip to content
Snippets Groups Projects
Select Git revision
  • 0683be9c77db4c4ad67a16c06cf7e4561f33bd67
  • master default protected
  • 9.0
  • 8.0
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • nt-tools
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
  • v8.0.1982
  • v8.0.1980
  • v8.0.1978
  • v8.0.1976
  • v8.0.1974
  • v8.0.1972
  • v8.0.1970
  • v8.0.1968
  • v8.0.1966
41 results

stralloc.c

Blame
    • Fredrik Hübinette (Hubbe)'s avatar
      c3c703da
      fixed a small memory leak and added _memory_usage · c3c703da
      Fredrik Hübinette (Hubbe) authored
      Rev: bin/test_pike.pike:1.3
      Rev: src/ChangeLog:1.32
      Rev: src/array.c:1.4
      Rev: src/array.h:1.2
      Rev: src/builtin_functions.c:1.16
      Rev: src/builtin_functions.h:1.3
      Rev: src/callback.c:1.4
      Rev: src/callback.h:1.3
      Rev: src/constants.c:1.4
      Rev: src/constants.h:1.2
      Rev: src/language.yacc:1.15
      Rev: src/las.c:1.10
      Rev: src/las.h:1.3
      Rev: src/mapping.c:1.8
      Rev: src/mapping.h:1.2
      Rev: src/modules/call_out/call_out.c:1.4
      Rev: src/modules/pipe/pipe.c:1.7
      Rev: src/multiset.c:1.2
      Rev: src/multiset.h:1.2
      Rev: src/object.c:1.6
      Rev: src/object.h:1.4
      Rev: src/program.c:1.11
      Rev: src/program.h:1.4
      Rev: src/stralloc.c:1.8
      Rev: src/stralloc.h:1.4
      c3c703da
      History
      fixed a small memory leak and added _memory_usage
      Fredrik Hübinette (Hubbe) authored
      Rev: bin/test_pike.pike:1.3
      Rev: src/ChangeLog:1.32
      Rev: src/array.c:1.4
      Rev: src/array.h:1.2
      Rev: src/builtin_functions.c:1.16
      Rev: src/builtin_functions.h:1.3
      Rev: src/callback.c:1.4
      Rev: src/callback.h:1.3
      Rev: src/constants.c:1.4
      Rev: src/constants.h:1.2
      Rev: src/language.yacc:1.15
      Rev: src/las.c:1.10
      Rev: src/las.h:1.3
      Rev: src/mapping.c:1.8
      Rev: src/mapping.h:1.2
      Rev: src/modules/call_out/call_out.c:1.4
      Rev: src/modules/pipe/pipe.c:1.7
      Rev: src/multiset.c:1.2
      Rev: src/multiset.h:1.2
      Rev: src/object.c:1.6
      Rev: src/object.h:1.4
      Rev: src/program.c:1.11
      Rev: src/program.h:1.4
      Rev: src/stralloc.c:1.8
      Rev: src/stralloc.h:1.4
    module.c 1.22 KiB
    /*\
    ||| This file a part of Pike, and is copyright by Fredrik Hubinette
    ||| Pike is distributed as GPL (General Public License)
    ||| See the files COPYING and DISCLAIMER for more information.
    \*/
    #include "global.h"
    #include "module.h"
    #include "macros.h"
    #include "error.h"
    #include "builtin_functions.h"
    #include "main.h"
    #include "svalue.h"
    #include "interpret.h"
    #include "stralloc.h"
    #include "object.h"
    #include "mapping.h"
    
    #include "modules/modlist_headers.h"
    
    typedef void (*modfun)(void);
    
    struct static_module
    {
      char *name;
      modfun init;
      modfun exit;
    };
    
    static struct static_module module_list[] = {
      { "Builtin", init_main, exit_main }
    #include "modules/modlist.h"
    };
    
    void init_modules(void)
    {
      unsigned int e;
      struct mapping *m = allocate_mapping(10);
      m->refs++;
      push_text("_static_modules");
      push_mapping(m);
      f_add_constant(2);
    
      for(e=0;e<NELEM(module_list);e++)
      {
        struct program *p;
        struct pike_string *s;
        start_new_program();
        module_list[e].init();
        p=end_program();
    
        push_text(module_list[e].name); 
        push_program(p);
        mapping_insert(m, sp-2, sp-1);
        pop_n_elems(2);
      }
    }
    
    void exit_modules(void)
    {
      int e;
      for(e=NELEM(module_list)-1;e>=0;e--)
        module_list[e].exit();
    }