File: leak.c

package info (click to toggle)
libaudio-scan-perl 0.93%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,152 kB
  • sloc: ansic: 11,482; perl: 241; sh: 48; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Compile with: cc -I.. -o leak leak.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
// Run with    : valgrind --leak-check=full ./leak

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "tagutils-common.h"
#include "tagutils-flac.c"

static PerlInterpreter *my_perl;

int main(int argc, char** argv) {
  int i = 0;
  char* file = argv[1];

  my_perl = perl_alloc();
  perl_construct(my_perl);

  for (i = 0; i < 5000; i++) {
    HV* info = newHV();
    HV* tags = newHV();

    get_flac_metadata(file, info, tags);
  }

  perl_destruct(my_perl);
  perl_free(my_perl);

  return 0;
}