emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 52c846d: Print module structure sizes when initiali


From: Philipp Stephani
Subject: [Emacs-diffs] master 52c846d: Print module structure sizes when initializing test module
Date: Mon, 12 Jun 2017 17:46:41 -0400 (EDT)

branch: master
commit 52c846d45dc52365349fc71e15d305a20788ce00
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Print module structure sizes when initializing test module
    
    * test/data/emacs-module/mod-test.c (emacs_module_init): Print
    compile-time and runtime sizes of module structures to ease debugging
---
 test/data/emacs-module/mod-test.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/test/data/emacs-module/mod-test.c 
b/test/data/emacs-module/mod-test.c
index 5e857c0..eee9466 100644
--- a/test/data/emacs-module/mod-test.c
+++ b/test/data/emacs-module/mod-test.c
@@ -265,12 +265,22 @@ int
 emacs_module_init (struct emacs_runtime *ert)
 {
   if (ert->size < sizeof *ert)
-    return 1;
+    {
+      fprintf (stderr, "Runtime size of runtime structure (%td bytes) "
+               "smaller than compile-time size (%zu bytes)",
+               ert->size, sizeof *ert);
+      return 1;
+    }
 
   emacs_env *env = ert->get_environment (ert);
 
   if (env->size < sizeof *env)
-    return 2;
+    {
+      fprintf (stderr, "Runtime size of environment structure (%td bytes) "
+               "smaller than compile-time size (%zu bytes)",
+               env->size, sizeof *env);
+      return 2;
+    }
 
 #define DEFUN(lsym, csym, amin, amax, doc, data) \
   bind_function (env, lsym, \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]