View Issue Details

IDProjectCategoryView StatusLast Update
0000672LDMudOtherpublic2009-09-16 16:16
Reporter_xtian_ Assigned Tozesstra  
PrioritynormalSeveritytweakReproducibilityhave not tried
Status resolvedResolutionfixed 
Summary0000672: [PATCH] "status malloc": output the mem allocator type
DescriptionTrivial patch to output the name of the used allocator on "status malloc" for the other 3 allocators that don't already do this.
TagsNo tags attached.
External Data (URL)

Relationships

related to 0000165 closedGnomi LDMud 3.5 Make hard coded commands independent of 'wizard'ness 

Activities

2009-09-16 04:58

 

output_xalloctype.patch (1,554 bytes)   
Index: src/slaballoc.c
===================================================================
--- src/slaballoc.c	(revision 2714)
+++ src/slaballoc.c	(working copy)
@@ -931,6 +931,7 @@
 
 #   define dump_stat(str,stat) strbuf_addf(sbuf, str,stat.counter,stat.size)
 
+    strbuf_add(sbuf, "Using LDMUD slaballoc.\n");
     strbuf_add(sbuf, "Type                   Count      Space (bytes)\n");
     dump_stat("xallocs:           %8lu        %10lu\n\n", xalloc_st);
     dump_stat("sbrk requests:     %8lu        %10lu (a)\n",sbrk_st);
Index: src/smalloc.c
===================================================================
--- src/smalloc.c	(revision 2714)
+++ src/smalloc.c	(working copy)
@@ -828,6 +828,7 @@
 
 #   define dump_stat(str,stat) strbuf_addf(sbuf, str,stat.counter,stat.size)
 
+    strbuf_add(sbuf, "Using LDMUD smalloc.\n");
     strbuf_add(sbuf, "Type                   Count      Space (bytes)\n");
     dump_stat("xallocs:           %8lu        %10lu\n\n", xalloc_st);
     dump_stat("sbrk requests:     %8lu        %10lu (a)\n",sbrk_st);
Index: src/xptmalloc.c
===================================================================
--- src/xptmalloc.c	(revision 2714)
+++ src/xptmalloc.c	(working copy)
@@ -124,6 +124,7 @@
 
 #   define dump_stat(str,member) strbuf_addf(sbuf, str, stats.member)
 
+    strbuf_add(sbuf, "Using LDMUD xptmalloc.\n");
     strbuf_add(sbuf, "Type                         Amount\n");
     dump_stat("total non-mmaped:          %8d bytes\n", arena);
     dump_stat("number of free chunks:     %8d\n", ordblks);
output_xalloctype.patch (1,554 bytes)   

zesstra

2009-09-16 05:40

administrator   ~0001266

Ah, this clashes somewhat with our plan to remove commands like status from the driver (see 0000165). ;-)
Comments?

_xtian_

2009-09-16 07:07

reporter   ~0001267

discard it, if you want, no worries. It was just 2mins. My incentive was to detect the active allocator at runtime (from inside the mud). There seems to also be a debug_info(6,2) to get this. But including it in status malloc was more agreeable.

zesstra

2009-09-16 09:43

administrator   ~0001270

Ok, it is a quite small patch. I don't mind to apply it, even if we remove status soon (in 3.3.x status will anyway be available until that branch is not supported anymore).

zesstra

2009-09-16 16:16

administrator   ~0001272

Applied in r2745 and r2745. Thanks. ;-)

Issue History

Date Modified Username Field Change
2009-09-16 04:58 _xtian_ New Issue
2009-09-16 04:58 _xtian_ File Added: output_xalloctype.patch
2009-09-16 05:40 zesstra Note Added: 0001266
2009-09-16 05:40 zesstra Relationship added related to 0000165
2009-09-16 07:07 _xtian_ Note Added: 0001267
2009-09-16 09:43 zesstra Note Added: 0001270
2009-09-16 09:43 zesstra Assigned To => zesstra
2009-09-16 09:43 zesstra Status new => assigned
2009-09-16 16:16 zesstra Note Added: 0001272
2009-09-16 16:16 zesstra Status assigned => resolved
2009-09-16 16:16 zesstra Fixed in Version => 3.3.719
2009-09-16 16:16 zesstra Resolution open => fixed