Split guardedalloc print into 2 funcs, 1 that prints on errors, another then prints the memory blocks as a python dict, minor changes to help text
This commit is contained in:
@@ -99,6 +99,10 @@ extern "C" {
|
|||||||
* */
|
* */
|
||||||
void *MEM_mapallocN(unsigned int len, const char * str);
|
void *MEM_mapallocN(unsigned int len, const char * str);
|
||||||
|
|
||||||
|
/** Print a list of the names and sizes of all allocated memory
|
||||||
|
* blocks. as a python dict for easy investigation */
|
||||||
|
void MEM_printmemlist_pydict(void);
|
||||||
|
|
||||||
/** Print a list of the names and sizes of all allocated memory
|
/** Print a list of the names and sizes of all allocated memory
|
||||||
* blocks. */
|
* blocks. */
|
||||||
void MEM_printmemlist(void);
|
void MEM_printmemlist(void);
|
||||||
|
@@ -334,7 +334,7 @@ void *MEM_mapallocN(unsigned int len, const char *str)
|
|||||||
|
|
||||||
|
|
||||||
/* Prints in python syntax for easy */
|
/* Prints in python syntax for easy */
|
||||||
void MEM_printmemlist()
|
static void MEM_printmemlist_internal( int pydict )
|
||||||
{
|
{
|
||||||
MemHead *membl;
|
MemHead *membl;
|
||||||
|
|
||||||
@@ -343,14 +343,21 @@ void MEM_printmemlist()
|
|||||||
membl = membase->first;
|
membl = membase->first;
|
||||||
if (membl) membl = MEMNEXT(membl);
|
if (membl) membl = MEMNEXT(membl);
|
||||||
|
|
||||||
|
if (pydict) {
|
||||||
print_error("# membase_debug.py\n");
|
print_error("# membase_debug.py\n");
|
||||||
print_error("membase = [\\\n");
|
print_error("membase = [\\\n");
|
||||||
|
}
|
||||||
while(membl) {
|
while(membl) {
|
||||||
|
if (pydict) {
|
||||||
fprintf(stderr, "{'len':%i, 'name':'''%s''', 'pointer':'%p'},\\\n", membl->len, membl->name, membl+1);
|
fprintf(stderr, "{'len':%i, 'name':'''%s''', 'pointer':'%p'},\\\n", membl->len, membl->name, membl+1);
|
||||||
|
} else {
|
||||||
|
print_error("%s len: %d %p\n",membl->name,membl->len, membl+1);
|
||||||
|
}
|
||||||
if(membl->next)
|
if(membl->next)
|
||||||
membl= MEMNEXT(membl->next);
|
membl= MEMNEXT(membl->next);
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
if (pydict) {
|
||||||
fprintf(stderr, "]\n\n");
|
fprintf(stderr, "]\n\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"mb_userinfo = {}\n"
|
"mb_userinfo = {}\n"
|
||||||
@@ -368,10 +375,18 @@ void MEM_printmemlist()
|
|||||||
"\tfor item in mb_userinfo_sort:\n"
|
"\tfor item in mb_userinfo_sort:\n"
|
||||||
"\t\tprint 'name:%%s, users:%%i, len:%%i' %% (item[0], item[1][0], item[1][1])\n"
|
"\t\tprint 'name:%%s, users:%%i, len:%%i' %% (item[0], item[1][0], item[1][1])\n"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
mem_unlock_thread();
|
mem_unlock_thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MEM_printmemlist( void ) {
|
||||||
|
MEM_printmemlist_internal(0);
|
||||||
|
}
|
||||||
|
void MEM_printmemlist_pydict( void ) {
|
||||||
|
MEM_printmemlist_internal(1);
|
||||||
|
}
|
||||||
|
|
||||||
short MEM_freeN(void *vmemh) /* anders compileertie niet meer */
|
short MEM_freeN(void *vmemh) /* anders compileertie niet meer */
|
||||||
{
|
{
|
||||||
short error = 0;
|
short error = 0;
|
||||||
|
@@ -1399,7 +1399,7 @@ void screenmain(void)
|
|||||||
else if (event==QKEY) {
|
else if (event==QKEY) {
|
||||||
/* Temp place to print mem debugging info ctrl+alt+shift + qkey */
|
/* Temp place to print mem debugging info ctrl+alt+shift + qkey */
|
||||||
if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
||||||
MEM_printmemlist();
|
MEM_printmemlist_pydict();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT);
|
else if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT);
|
||||||
|
@@ -176,8 +176,10 @@ static void print_help(void)
|
|||||||
printf (" ...may not render to /tmp because '-f 1' renders before the output path is set\n");
|
printf (" ...may not render to /tmp because '-f 1' renders before the output path is set\n");
|
||||||
printf (" blender -b -o /tmp test.blend -f 1\n");
|
printf (" blender -b -o /tmp test.blend -f 1\n");
|
||||||
printf (" ...may not render to /tmp because loading the blend file overwrites the output path that was set\n");
|
printf (" ...may not render to /tmp because loading the blend file overwrites the output path that was set\n");
|
||||||
|
printf (" \"blender -b test.blend -o /tmp -f 1\" works as expected.\n");
|
||||||
printf ("\nRender options:\n");
|
printf ("\nRender options:\n");
|
||||||
printf (" -b <file>\tRender <file> in background\n");
|
printf (" -b <file>\tRender <file> in background\n");
|
||||||
|
printf (" -a render frames from start to end (inclusive), only works when used after -b\n");
|
||||||
printf (" -S <name>\tSet scene <name>\n");
|
printf (" -S <name>\tSet scene <name>\n");
|
||||||
printf (" -f <frame>\tRender frame <frame> and save it\n");
|
printf (" -f <frame>\tRender frame <frame> and save it\n");
|
||||||
printf (" -s <frame>\tSet start to frame <frame> (use with -a)\n");
|
printf (" -s <frame>\tSet start to frame <frame> (use with -a)\n");
|
||||||
@@ -186,16 +188,25 @@ static void print_help(void)
|
|||||||
printf (" Use // at the start of the path to\n");
|
printf (" Use // at the start of the path to\n");
|
||||||
printf (" render relative to the blend file.\n");
|
printf (" render relative to the blend file.\n");
|
||||||
printf (" The frame number will be added at the end of the filename.\n");
|
printf (" The frame number will be added at the end of the filename.\n");
|
||||||
printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1\n");
|
printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n");
|
||||||
printf (" -F <format>\tSet the render format, Valid options are..\n");
|
printf ("\nFormat options:\n");
|
||||||
|
printf (" -F <format>\tSet the render format, Valid options are...\n");
|
||||||
printf (" \tTGA IRIS HAMX JPEG MOVIE IRIZ RAWTGA\n");
|
printf (" \tTGA IRIS HAMX JPEG MOVIE IRIZ RAWTGA\n");
|
||||||
printf (" \tAVIRAW AVIJPEG PNG BMP FRAMESERVER\n");
|
printf (" \tAVIRAW AVIJPEG PNG BMP FRAMESERVER\n");
|
||||||
printf (" (formats that can be compiled into blender, not available on all systems)\n");
|
printf (" (formats that can be compiled into blender, not available on all systems)\n");
|
||||||
printf (" \tHDR TIFF EXR MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
|
printf (" \tHDR TIFF EXR MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
|
||||||
printf (" -x <bool>\tSet option to add the file extension to the end of the file.\n");
|
printf (" -x <bool>\tSet option to add the file extension to the end of the file.\n");
|
||||||
printf (" -t <threads>\tUse amount of <threads> for rendering\n");
|
printf (" -t <threads>\tUse amount of <threads> for rendering\n");
|
||||||
printf ("\nAnimation options:\n");
|
/*Add these later - Campbell*/
|
||||||
printf (" -a <file(s)>\tPlayback <file(s)>\n");
|
/*
|
||||||
|
printf (" -colorchannel <type>\tColors to save, valid types are: BW RGB RGBA \n");
|
||||||
|
printf (" -compression <type>\t Use with EXR format, valid types are..\n");
|
||||||
|
printf (" \tZIP Pxr24 PIZ RLE\n");
|
||||||
|
printf (" -zbuf <bool>\tUse with EXR format, set the zbuf save option\n");
|
||||||
|
printf (" -halffloat <bool>\tUse with EXR format, set the half float option\n");
|
||||||
|
printf (" -preview <bool>\tUse with EXR format, save a jpeg for viewing as well as the EXR\n");*/
|
||||||
|
printf ("\nAnimation playback options:\n");
|
||||||
|
printf (" -a <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
|
||||||
printf (" -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
|
printf (" -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
|
||||||
printf (" -m\t\tRead from disk (Don't buffer)\n");
|
printf (" -m\t\tRead from disk (Don't buffer)\n");
|
||||||
printf (" -f <fps> <fps-base>\t\tSpecify FPS to start with\n");
|
printf (" -f <fps> <fps-base>\t\tSpecify FPS to start with\n");
|
||||||
@@ -337,7 +348,7 @@ int main(int argc, char **argv)
|
|||||||
/* Handle -* switches */
|
/* Handle -* switches */
|
||||||
else if(argv[a][0] == '-') {
|
else if(argv[a][0] == '-') {
|
||||||
switch(argv[a][1]) {
|
switch(argv[a][1]) {
|
||||||
case 'a':
|
case 'a': /* -b was not given, play an animation */
|
||||||
playanim(argc-1, argv+1);
|
playanim(argc-1, argv+1);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user