Changeset 16955


Ignore:
Timestamp:
2013-08-31T18:47:34+02:00 (11 years ago)
Author:
sjoelund.se
Message:

Fewer global symbols, compile fewer functions

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.common

    r16615 r16955  
    8484  cp -pP $< $@
    85853rdParty/gc-7.2/Makefile: 3rdParty/gc-7.2/Makefile.in 3rdParty/gc-7.2/configure
    86   (cd 3rdParty/gc-7.2 && ./configure --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)")
     86  (cd 3rdParty/gc-7.2 && ./configure $(GC_THREADS) --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK")
    8787
    8888fmi: interactive
  • trunk/Makefile.in

    r16836 r16955  
    2525LINK=@LINK@
    2626MSL_EXTRA_ARGS=@MSL_EXTRA_ARGS@
     27GC_THREADS=--enable-threds=posix
    2728
    2829include Makefile.common
  • trunk/SimulationRuntime/c/Makefile.common

    r16793 r16955  
    77include Makefile.objs
    88
    9 CPPFLAGS = -g -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc $(LIBF2CINC) -I$(top_builddir)/3rdParty/gc-7.2/include -I$(top_builddir)/3rdParty/FMIL/install/include/ $(CONFIG_CPPFLAGS)
     9CPPFLAGS = -g -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc $(LIBF2CINC) -I$(top_builddir)/3rdParty/gc-7.2/include -I$(top_builddir)/3rdParty/FMIL/install/include/ $(CONFIG_CPPFLAGS)  -DGC_REDIRECT_TO_LOCAL
    1010CFLAGS = $(CPPFLAGS) $(CONFIG_CFLAGS) $(EXTRA_CFLAGS)
    1111CXXFLAGS = $(CFLAGS)
  • trunk/SimulationRuntime/c/meta/gc/generational.c

    r15963 r16955  
    8282#include "generational.h"
    8383
     84#ifdef _MMC_GC_
     85
    8486/*#undef NDEBUG*/
    8587#include <assert.h>
     
    10381040}
    10391041
    1040 
    1041 
     1042#endif
  • trunk/SimulationRuntime/c/meta/gc/generational.h

    r15963 r16955  
    4848
    4949#include "modelica.h"
     50#include "mmc_gc.h"
    5051
    5152/* the allocated from C region */
  • trunk/SimulationRuntime/c/meta/gc/marksweep.c

    r15963 r16955  
    4141
    4242#include "modelica.h"
     43#include "mmc_gc.h"
    4344
    4445#if defined(_MMC_GC_)
     
    593594static mmc_GC_state_type x_mmc_GC_state;
    594595mmc_GC_state_type *mmc_GC_state = &x_mmc_GC_state;
    595 mmc_GC_local_state_type dummy_local_GC_state = 0;
    596596
    597597/* primary allocation routine for MetaModelica */
     
    605605static mmc_GC_state_type x_mmc_GC_state;
    606606mmc_GC_state_type *mmc_GC_state = &x_mmc_GC_state;
    607 mmc_GC_local_state_type dummy_local_GC_state = 0;
    608607
    609608void *mmc_alloc_bytes(unsigned nbytes)
     
    655654  return 0;
    656655}
    657 
  • trunk/SimulationRuntime/c/meta/gc/mmc_gc.h

    r15963 r16955  
    121121#if defined(_MMC_USE_BOEHM_GC_) /* use the BOEHM Garbage collector */
    122122
    123 extern mmc_GC_local_state_type dummy_local_GC_state;
    124 
    125123#define LARGE_CONFIG
    126124#include <gc.h>
     
    132130
    133131#else /* NO_GC */
    134 
    135 extern mmc_GC_local_state_type dummy_local_GC_state;
    136132
    137133#define mmc_GC_init(settings)
  • trunk/SimulationRuntime/c/meta/gc/roots.h

    r15963 r16955  
    9797#define mmc_GC_add_root(A,B,C)
    9898#define mmc_GC_add_roots(p, n, local_GC_state, name)
    99 #define mmc_GC_save_roots_state(name)                  (dummy_local_GC_state)
     99#define mmc_GC_save_roots_state(name)                  (0)
    100100#define mmc_GC_undo_roots_state(local_GC_state)
    101101#define mmc_GC_unwind_roots_state(local_GC_state)
  • trunk/SimulationRuntime/c/meta/meta_modelica.h

    r16910 r16955  
    236236#define mmc_mk_bcon(X) ((X) != 0 ? MMC_TRUE : MMC_FALSE)
    237237
    238 static inline void* mmc_mk_icon(mmc_sint_t i)
     238static void* mmc_mk_icon(mmc_sint_t i)
    239239{
    240240    return MMC_IMMEDIATE(MMC_TAGFIXNUM(i));
     
    247247    mmc_uint_t data[2];
    248248};
    249 static inline double mmc_prim_get_real(void *p)
     249static double mmc_prim_get_real(void *p)
    250250{
    251251  union mmc_double_as_words u;
     
    257257}
    258258
    259 static inline void mmc_prim_set_real(struct mmc_real *p, double d)
     259static void mmc_prim_set_real(struct mmc_real *p, double d)
    260260{
    261261  union mmc_double_as_words u;
     
    268268}
    269269
    270 static inline void* mmc_mk_scon(const char *s)
     270static void* mmc_mk_scon(const char *s)
    271271{
    272272    unsigned nbytes = strlen(s);
     
    291291}
    292292
    293 static inline void* mmc_mk_scon_len(unsigned nbytes)
     293static void* mmc_mk_scon_len(unsigned nbytes)
    294294{
    295295    unsigned header = MMC_STRINGHDR(nbytes);
     
    305305char* mmc_mk_scon_len_ret_ptr(size_t nbytes);
    306306
    307 static inline void *mmc_mk_box0(unsigned ctor)
     307static void *mmc_mk_box0(unsigned ctor)
    308308{
    309309    struct mmc_struct *p = (struct mmc_struct *) mmc_alloc_words(1);
     
    315315}
    316316
    317 static inline void *mmc_mk_box1(unsigned ctor, void *x0)
     317static void *mmc_mk_box1(unsigned ctor, void *x0)
    318318{
    319319  mmc_GC_add_roots(&x0, 1, 0, "");
     
    331331void printAny(void* any);
    332332
    333 static inline void *mmc_mk_box2(unsigned ctor, void *x0, void *x1)
     333static void *mmc_mk_box2(unsigned ctor, void *x0, void *x1)
    334334{
    335335  mmc_GC_add_roots(&x0, 1, 0, "");
     
    350350}
    351351
    352 static inline void *mmc_mk_box3(unsigned ctor, void *x0, void *x1, void *x2)
     352static void *mmc_mk_box3(unsigned ctor, void *x0, void *x1, void *x2)
    353353{
    354354  mmc_GC_add_roots(&x0, 1, 0, "");
     
    371371}
    372372
    373 static inline void *mmc_mk_box4(unsigned ctor, void *x0, void *x1, void *x2, void *x3)
     373static void *mmc_mk_box4(unsigned ctor, void *x0, void *x1, void *x2, void *x3)
    374374{
    375375  mmc_GC_add_roots(&x0, 1, 0, "");
     
    393393}
    394394
    395 static inline void *mmc_mk_box5(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4)
     395static void *mmc_mk_box5(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4)
    396396{
    397397  mmc_GC_add_roots(&x0, 1, 0, "");
     
    417417}
    418418
    419 static inline void *mmc_mk_box6(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5)
     419static void *mmc_mk_box6(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5)
    420420{
    421421  mmc_GC_add_roots(&x0, 1, 0, "");
     
    443443}
    444444
    445 static inline void *mmc_mk_box7(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5, void *x6)
     445static void *mmc_mk_box7(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5, void *x6)
    446446{
    447447  mmc_GC_add_roots(&x0, 1, 0, "");
     
    471471}
    472472
    473 static inline void *mmc_mk_box8(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5, void *x6, void *x7)
     473static void *mmc_mk_box8(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5, void *x6, void *x7)
    474474{
    475475  mmc_GC_add_roots(&x0, 1, 0, "");
     
    501501}
    502502
    503 static inline void *mmc_mk_box9(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5, void *x6, void *x7, void *x8)
     503static void *mmc_mk_box9(unsigned ctor, void *x0, void *x1, void *x2, void *x3, void *x4, void *x5, void *x6, void *x7, void *x8)
    504504{
    505505  mmc_GC_add_roots(&x0, 1, 0, "");
     
    533533}
    534534
    535 static inline void *mmc_mk_box(int slots, unsigned ctor, ...)
     535static void *mmc_mk_box(int slots, unsigned ctor, ...)
    536536{
    537537    int i;
     
    570570#define MMC_CONS_CTOR 1
    571571
    572 static inline void *mmc_mk_cons(void *car, void *cdr)
     572static void *mmc_mk_cons(void *car, void *cdr)
    573573{
    574574    return mmc_mk_box2(MMC_CONS_CTOR, car, cdr);
    575575}
    576576
    577 static inline void *mmc_mk_some(void *x)
     577static void *mmc_mk_some(void *x)
    578578{
    579579    return mmc_mk_box1(1, x);
  • trunk/SimulationRuntime/c/simulation/simulation_runtime.cpp

    r16918 r16955  
    10031003void (*omc_terminate)(FILE_INFO info, const char *msg, ...) = omc_terminate_simulation;
    10041004void (*omc_throw)() = omc_throw_simulation;
     1005
     1006/* simulation JumpBuffer */
     1007jmp_buf simulationJmpbuf;
     1008
     1009/* integrator JumpBuffer */
     1010jmp_buf integratorJmpbuf;
     1011
     1012/* indicates the current possible jump place */
     1013int currectJumpState;
  • trunk/SimulationRuntime/c/simulation/simulation_runtime.h

    r16918 r16955  
    22 * This file is part of OpenModelica.
    33 *
    4  * Copyright (c) 1998-CurrentYear, Linköping University,
    5  * Department of Computer and Information Science,
     4 * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
     5 * c/o Linköpings universitet, Department of Computer and Information Science,
    66 * SE-58183 Linköping, Sweden.
    77 *
    88 * All rights reserved.
    99 *
    10  * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
    11  * AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
    12  * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
    13  * ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
     10 * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE
     11 * GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
     12 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
     13 * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
     14 * ACCORDING TO RECIPIENTS CHOICE.
     15 *
     16 * The OpenModelica software and the OSMC (Open Source Modelica Consortium)
     17 * Public License (OSMC-PL) are obtained from OSMC, either from the above
     18 * address, from the URLs: http://www.openmodelica.org or
     19 * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica
     20 * distribution. GNU version 3 is obtained from:
     21 * http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from:
     22 * http://www.opensource.org/licenses/BSD-3-Clause.
    1423 *
    15  * The OpenModelica software and the Open Source Modelica
    16  * Consortium (OSMC) Public License (OSMC-PL) are obtained
    17  * from Linköping University, either from the above address,
    18  * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
    19  * http://www.openmodelica.org, and in the OpenModelica distribution.
    20  * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
    21  *
    22  * This program is distributed WITHOUT ANY WARRANTY; without
    23  * even the implied warranty of  MERCHANTABILITY or FITNESS
    24  * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
    25  * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
    26  * OF OSMC-PL.
    27  *
    28  * See the full OSMC Public License conditions for more details.
     24 * This program is distributed WITHOUT ANY WARRANTY; without even the implied
     25 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS
     26 * EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE
     27 * CONDITIONS OF OSMC-PL.
    2928 *
    3029 */
     
    105104extern void communicateStatus(const char *phase, double completionPercent);
    106105
     106/* simulation JumpBuffer */
     107extern jmp_buf simulationJmpbuf;
     108
     109/* integrator JumpBuffer */
     110extern jmp_buf integratorJmpbuf;
     111
     112/* indicates the current possible jump place */
     113extern int currectJumpState;
     114
    107115#ifdef __cplusplus
    108116}
  • trunk/SimulationRuntime/c/simulation/solver/nonlinearSystem.c

    r16387 r16955  
    4444#include "blaswrap.h"
    4545#include "f2c.h"
     46#include "simulation_runtime.h"
     47
     48/* nonlinear JumpBuffer */
     49jmp_buf nonlinearJmpbuf;
    4650
    4751extern doublereal enorm_(integer *n, doublereal *x);
  • trunk/SimulationRuntime/c/simulation/solver/nonlinearSystem.h

    r16289 r16955  
    7474double extraPolate(DATA *data, double old1, double old2);
    7575
     76/* nonlinear JumpBuffer */
     77extern jmp_buf nonlinearJmpbuf;
     78
    7679#endif
  • trunk/SimulationRuntime/c/util/java_interface.c

    r15963 r16955  
    6363#endif
    6464
    65 const char* JAVA_MODELICA_ARRAY   = "org/openmodelica/ModelicaArray";
    66 const char* JAVA_MODELICA_INTEGER = "org/openmodelica/ModelicaInteger";
    67 const char* JAVA_MODELICA_REAL    = "org/openmodelica/ModelicaReal";
    68 const char* JAVA_MODELICA_BOOLEAN = "org/openmodelica/ModelicaBoolean";
    69 const char* JAVA_MODELICA_STRING  = "org/openmodelica/ModelicaString";
    70 const char* JAVA_MODELICA_RECORD  = "org/openmodelica/ModelicaRecord";
    71 const char* JAVA_MODELICA_OMCRECORD  = "org/openmodelica/OMCModelicaRecord";
    72 const char* JAVA_MODELICA_TUPLE   = "org/openmodelica/ModelicaTuple";
    73 const char* JAVA_MODELICA_OPTION  = "org/openmodelica/ModelicaOption";
    74 char* classPath;
    75 
    76 int inside_exception = 0;
    77 
    78 GetCreatedJavaVMsFunc OMC_GetCreatedJavaVMs = NULL;
    79 CreateJavaVMFunc OMC_CreateJavaVM = NULL;
     65static const char* JAVA_MODELICA_ARRAY   = "org/openmodelica/ModelicaArray";
     66static const char* JAVA_MODELICA_INTEGER = "org/openmodelica/ModelicaInteger";
     67static const char* JAVA_MODELICA_REAL    = "org/openmodelica/ModelicaReal";
     68static const char* JAVA_MODELICA_BOOLEAN = "org/openmodelica/ModelicaBoolean";
     69static const char* JAVA_MODELICA_STRING  = "org/openmodelica/ModelicaString";
     70static const char* JAVA_MODELICA_RECORD  = "org/openmodelica/ModelicaRecord";
     71static const char* JAVA_MODELICA_OMCRECORD  = "org/openmodelica/OMCModelicaRecord";
     72static const char* JAVA_MODELICA_TUPLE   = "org/openmodelica/ModelicaTuple";
     73static const char* JAVA_MODELICA_OPTION  = "org/openmodelica/ModelicaOption";
     74static char* classPath;
     75
     76static int inside_exception = 0;
     77
     78static GetCreatedJavaVMsFunc OMC_GetCreatedJavaVMs = NULL;
     79static CreateJavaVMFunc OMC_CreateJavaVM = NULL;
    8080
    8181
  • trunk/SimulationRuntime/c/util/omc_error.c

    r16387 r16955  
    3838/* Global JumpBuffer */
    3939jmp_buf globalJmpbuf;
    40 
    41 /* simulation JumpBuffer */
    42 jmp_buf simulationJmpbuf;
    43 
    44 /* integrator JumpBuffer */
    45 jmp_buf integratorJmpbuf;
    46 
    47 /* nonlinear JumpBuffer */
    48 jmp_buf nonlinearJmpbuf;
    49 
    50 /* indicates the current possible jump place */
    51 int currectJumpState;
    5240
    5341const int firstOMCErrorStream = 3;
  • trunk/SimulationRuntime/c/util/omc_error.h

    r16765 r16955  
    6464/* global JumpBuffer */
    6565extern jmp_buf globalJmpbuf;
    66 
    67 /* simulation JumpBuffer */
    68 extern jmp_buf simulationJmpbuf;
    69 
    70 /* integrator JumpBuffer */
    71 extern jmp_buf integratorJmpbuf;
    72 
    73 /* nonlinear JumpBuffer */
    74 extern jmp_buf nonlinearJmpbuf;
    75 
    76 /* indicates the current possible jump place */
    77 extern int currectJumpState;
    7866
    7967enum ERROR_HANDLE
Note: See TracChangeset for help on using the changeset viewer.