mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 18:25:08 +03:00
jemalloc.net (#1905)
* Create package.yml * Create test.c * concurrency issues on install --------- Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
parent
9f45a5d1b5
commit
3de2fce436
2 changed files with 42 additions and 0 deletions
29
projects/jemalloc.net/package.yml
Normal file
29
projects/jemalloc.net/package.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/jemalloc/jemalloc/releases/download/{{version}}/jemalloc-{{version}}.tar.bz2
|
||||||
|
strip-components: 1
|
||||||
|
|
||||||
|
versions:
|
||||||
|
github: jemalloc/jemalloc
|
||||||
|
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
tea.xyz/gx/cc: c99
|
||||||
|
tea.xyz/gx/make: '*'
|
||||||
|
gnu.org/autoconf: '*'
|
||||||
|
docbook.org: '*'
|
||||||
|
script: |
|
||||||
|
./configure $ARGS
|
||||||
|
make --jobs {{ hw.concurrency }}
|
||||||
|
make install
|
||||||
|
env:
|
||||||
|
ARGS:
|
||||||
|
- --prefix="{{prefix}}"
|
||||||
|
- --disable-debug
|
||||||
|
- --with-jemalloc-prefix=
|
||||||
|
|
||||||
|
test:
|
||||||
|
dependencies:
|
||||||
|
tea.xyz/gx/cc: c99
|
||||||
|
script: |
|
||||||
|
cc test.c -L {{prefix}}/lib -ljemalloc -o test
|
||||||
|
./test
|
13
projects/jemalloc.net/test.c
Normal file
13
projects/jemalloc.net/test.c
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <jemalloc/jemalloc.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
|
||||||
|
for (size_t i = 0; i < 1000; i++) {
|
||||||
|
// Leak some memory
|
||||||
|
malloc(i * 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dump allocator statistics to stderr
|
||||||
|
malloc_stats_print(NULL, NULL, NULL);
|
||||||
|
}
|
Loading…
Reference in a new issue