]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Made the setting of VG_(details).avg_translation_sizeB optional, defaulting to
authorNicholas Nethercote <njn@valgrind.org>
Mon, 3 Feb 2003 12:20:07 +0000 (12:20 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 3 Feb 2003 12:20:07 +0000 (12:20 +0000)
100 bytes (added VG_DEFAULT_TRANS_SIZEB).  Took the now-unnecessary settings
out of Nulgrind and CoreCheck.  Also made .avg_translation_sizeB a UInt (from
an Int), to avoid possibility of negatives.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1413

corecheck/cc_main.c
coregrind/vg_include.h
coregrind/vg_needs.c
example/ex_main.c
include/vg_skin.h
none/nl_main.c

index 1d1e93dd7726f156a79d2ce04f82baaf57c12bd6..b6c3e9660fc46fdd3a11e000b704305a0551498e 100644 (file)
@@ -41,7 +41,6 @@ void SK_(pre_clo_init)(void)
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.");
    VG_(details_bug_reports_to)  ("njn25@cam.ac.uk");
-   VG_(details_avg_translation_sizeB) ( 100 );
 
    VG_(needs_core_errors)();
 
index 394e57c0e74bdca5ad0c95523855c2349f574c6a..a45f660cc6bfad2ac0c54c6cc51ccf5ef6c62972 100644 (file)
@@ -293,7 +293,7 @@ typedef
       Char* description;
       Char* copyright_author;
       Char* bug_reports_to;
-      Int   avg_translation_sizeB;
+      UInt  avg_translation_sizeB;
    }
    VgDetails;
 
index 2caea8dfc29c40e5ba363f154f29aa120d0e4467..a83dcd364afdb35563df39d50b505a64bf536465 100644 (file)
@@ -43,7 +43,7 @@ VgDetails VG_(details) = {
    .description           = NULL,
    .copyright_author      = NULL,
    .bug_reports_to        = NULL,
-   .avg_translation_sizeB = 0
+   .avg_translation_sizeB = VG_DEFAULT_TRANS_SIZEB,
 };
 
 VgNeeds VG_(needs) = {
@@ -109,15 +109,15 @@ void VG_(sanity_check_needs) ( void)
    if ((var)==(value)) {                                    \
       VG_(printf)("\nSkin error: `%s' not initialised\n",   \
                   VG__STRING(var));                         \
-      VG_(skin_panic)("Uninitialised needs field\n");       \
+      VG_(skin_panic)("Uninitialised details field\n");     \
    }
    
+   /* Ones that must be set */
    CHECK_NOT(VG_(details).name,             NULL);
    /* Nb: .version can be NULL */
    CHECK_NOT(VG_(details).description,      NULL);
    CHECK_NOT(VG_(details).copyright_author, NULL);
    CHECK_NOT(VG_(details).bug_reports_to,   NULL);
-   CHECK_NOT(VG_(details).avg_translation_sizeB, 0);
 
 #undef CHECK_NOT
 #undef INVALID_Bool
@@ -138,7 +138,7 @@ DETAILS(Char*, version)
 DETAILS(Char*, description)
 DETAILS(Char*, copyright_author)
 DETAILS(Char*, bug_reports_to)
-DETAILS(Int, avg_translation_sizeB)
+DETAILS(UInt,  avg_translation_sizeB)
 
 /*--------------------------------------------------------------------*/
 /* Setting needs */
index deac4d595b31d15a6c8053fa5f9dfc3c8e6b163b..38664c668f583295cc4f4bc590f1c10505d9577f 100644 (file)
@@ -16,10 +16,6 @@ void SK_(pre_clo_init)()
       "Copyright (C) 2002, and put in the public domain, by Santa Claus.");
    VG_(details_bug_reports_to)  ("santa.claus@northpole.org");
 
-   /* Adjust this to be closer to reality once you have your skin
-      working. */
-   VG_(details_avg_translation_sizeB) ( 100 );
-
    /* No needs, no core events to track */
 }
 
index 6ad3ae664a01b8a63df58bd6de108aab4292d5ac..72c1392284ebdad92f24a0817cbcd7d2c8019ec4 100644 (file)
@@ -1220,6 +1220,10 @@ extern void VG_(generic_detect_memory_leaks) (
 /* ------------------------------------------------------------------ */
 /* Details */
 
+/* Default value for avg_translations_sizeB (in bytes), indicating typical
+   code expansion of about 6:1. */
+#define VG_DEFAULT_TRANS_SIZEB   100
+
 /* Information used in the startup message.  `name' also determines the
    string used for identifying suppressions in a suppression file as
    belonging to this skin.  `version' can be NULL, in which case (not
@@ -1233,10 +1237,9 @@ extern void VG_(details_description)           ( Char* description );
 extern void VG_(details_copyright_author)      ( Char* copyright_author );
 
 /* Average size of a translation, in bytes, so that the translation
-   storage machinery can allocate memory appropriately.  Not critical.
-   If you're unsure, set to 100 (indicating typical code expansion of
-   about 6:1). */
-extern void VG_(details_avg_translation_sizeB) ( Int );
+   storage machinery can allocate memory appropriately.  Not critical,
+   setting is optional. */ 
+extern void VG_(details_avg_translation_sizeB) ( UInt size );
 
 /* String printed if an `sk_assert' assertion fails or VG_(skin_panic)
    is called.  Should probably be an email address. */
index 2f236d6d8f37dec11b373288b21698754aabebc8..dc31c817079de57d6cdf7ae0fb6ecd68b5db6350 100644 (file)
@@ -40,7 +40,6 @@ void SK_(pre_clo_init)(void)
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.");
    VG_(details_bug_reports_to)  ("njn25@cam.ac.uk");
-   VG_(details_avg_translation_sizeB) ( 100 );
 
    /* No needs, no core events to track */
 }