Crossfire Server, Trunk
perf_mapsave.c
Go to the documentation of this file.
1 #include "global.h"
2 
3 #ifdef HAVE_GPERFTOOLS_PROFILER_H
4 #include <gperftools/profiler.h>
5 #endif
6 
7 int main(int argc, char *argv[]) {
8  if (argc < 3) {
9  puts("usage: perf_mapsave PATH N_TIMES");
10  return 0;
11  }
12 
14  init_library();
15  int flags = 0;
16  if (argv[1][0] == '~') {
18  }
19 #ifdef HAVE_GPERFTOOLS_PROFILER_H
20  ProfilerStart("mapsave.prof");
21 #endif
22  for (int i = 0; i < (int)strtol(argv[2], NULL, 10); i++) {
23  mapstruct *m = mapfile_load(argv[1], flags);
24  if (m == NULL) {
25  break;
26  }
27  save_map(m, 0);
28  free_map(m);
29  }
30 #ifdef HAVE_GPERFTOOLS_PROFILER_H
31  ProfilerStop();
32 #endif
33 }
global.h
MAP_PLAYER_UNIQUE
#define MAP_PLAYER_UNIQUE
Definition: map.h:97
flags
static const flag_definition flags[]
Definition: gridarta-types-convert.c:101
settings
struct Settings settings
Definition: init.c:39
m
static event_registration m
Definition: citylife.cpp:425
Settings::debug
LogLevel debug
Definition: global.h:240
free_map
void free_map(mapstruct *m)
Definition: map.c:1670
mapdef
Definition: map.h:324
save_map
int save_map(mapstruct *m, int flag)
Definition: map.c:1416
main
int main(int argc, char *argv[])
Definition: perf_mapsave.c:7
make_face_from_files.int
int
Definition: make_face_from_files.py:26
init_library
void init_library(void)
Definition: init.c:188
llevDebug
@ llevDebug
Definition: logger.h:13
mapfile_load
mapstruct * mapfile_load(const char *map, int flags)
Definition: map.c:1210