Skip to content

Commit b8d53bc

Browse files
committed
Add malloc versions
1 parent c6f6450 commit b8d53bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source-code/cython/Primes/primes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
if __name__ == '__main__':
88
arg_parser = ArgumentParser(description='compute primes')
9-
arg_parser.add_argument('version', choices=['python', 'cython', 'pure_python'],
9+
arg_parser.add_argument('version', choices=['python', 'cython', 'pure_python', 'cython_malloc', 'pure_malloc'],
1010
help='version to run')
1111
arg_parser.add_argument('--n', type=int, default=10,
1212
help='number of primes')
@@ -15,7 +15,11 @@
1515
from primes_vanilla import primes
1616
elif options.version == 'cython':
1717
from primes_cython import primes
18+
elif options.version == 'cython_malloc':
19+
from primes_malloc import primes
1820
elif options.version == 'pure_python':
1921
from primes_pure_python import primes
22+
elif options.version == 'pure_malloc':
23+
from primes_pure_malloc import primes
2024
results = primes(options.n)
2125
print(', '.join(map(str, results)))

0 commit comments

Comments
 (0)